From patchwork Tue Oct 1 14:56:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 174872 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8663588ill; Tue, 1 Oct 2019 07:56:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMn3fT5HtISxoUMTxo4pVB+UQ4krZOy7vWfQkJb8FUUU/X5JVhZpw7VkwJVBjIwRIUkmyc X-Received: by 2002:a05:6402:17a2:: with SMTP id j2mr26124253edy.121.1569941769776; Tue, 01 Oct 2019 07:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569941769; cv=none; d=google.com; s=arc-20160816; b=sWnZUp1ZTJZQVbPZTVYEi53FQIH9zwUDoGJyn+DL69lDjiIfHxXVgdMLdHOnznLDNE L5iBAiU2acvf2b/2VwQ+jKvGysdDioEhazx20sg1FcF4ju6OeeG5cDlYWwDQAvwp0jL9 UJGQoa/R5FFJcq/K1Usd58xxqQRiI2ybUnFrVxNMdzovi9ZE4/9HmqyUiGlaL919MLFd agFU7k4BJ+Y+q3wQSaDTc+EeuMkpaOYMJKUwWU2OBKmcLnlCzgHzvJovCG0tES2DqEzW sGUeqscYE1w908hTFy01Qp0Up5D5WkrB8DXrrEpFuwUa+GxRiKsZ1LF1Tt7ChEbYXQEr 8Hcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vNLixCA7rV3r89geVpDyZT2afzJln66pkNhtKdigswM=; b=Mg4rGENZpjXnTRuV900weT8Jt1Y8pYZA+kz5d1ijRabz7JPVaP5DXRLCgcIkbXztW8 fLGM8JzUnHa586s4ZIBENJ9quwo78sDdiKH8RPZsYHTy0EOnGquRv8ZsWvfRS/DF+rUi kilCg7oHg0lDt6c6vJGam5ItkIhXhhkU7i93QSaoYY2mFdBbZjaKxfVI7IgjWelY8LIP ietmnAmal+0FRffjpfQ5Yq6oYEmtm3GpXxyXwLfxDWRvBYncOXaaPo0QN97nqQ9fyny2 QJULJRuouRb8SGjP3GnjGZfUkdRJzET6qWg6B5l6Yk61Y4rrtYW0HT9vJ8UAox3SXWzz 2MeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=vwcfcPJ5; 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 s14si8535929eju.289.2019.10.01.07.56.09; Tue, 01 Oct 2019 07:56:09 -0700 (PDT) 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=vwcfcPJ5; 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 S2389346AbfJAO4J (ORCPT + 1 other); Tue, 1 Oct 2019 10:56:09 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:50116 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389278AbfJAO4J (ORCPT ); Tue, 1 Oct 2019 10:56:09 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu5H1007758; Tue, 1 Oct 2019 09:56:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569941765; bh=vNLixCA7rV3r89geVpDyZT2afzJln66pkNhtKdigswM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vwcfcPJ5GjUniCRUN25l5Qtz+OFPZE9gvl7ubhA99gNT/whzeK6Eg5wHKut1vQVNB yAbmYw0G3B+cikNY/YnR4mvJXFk2gFnlX4K64XLpBQEzzLrnXO2OImo7xYdxTX4HMx GSDPXiEOmrSwZe0Hq64eMnWlxVWCA5Kv3SyUDC44= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu58E063970; Tue, 1 Oct 2019 09:56:05 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 1 Oct 2019 09:55:54 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 1 Oct 2019 09:56:04 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu4O8044661; Tue, 1 Oct 2019 09:56:04 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v10 03/16] leds: Add multicolor ID to the color ID list Date: Tue, 1 Oct 2019 09:56:07 -0500 Message-ID: <20191001145620.11123-4-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191001145620.11123-1-dmurphy@ti.com> References: <20191001145620.11123-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 Add a new color ID that is declared as MULTICOLOR as with the multicolor framework declaring a definitive color is not accurate as the node can contain multiple colors. Signed-off-by: Dan Murphy --- drivers/leds/led-core.c | 1 + 1 file changed, 1 insertion(+) -- 2.22.0.214.g8dca754b1e diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c index f1f718dbe0f8..846248a0693d 100644 --- a/drivers/leds/led-core.c +++ b/drivers/leds/led-core.c @@ -34,6 +34,7 @@ const char * const led_colors[LED_COLOR_ID_MAX] = { [LED_COLOR_ID_VIOLET] = "violet", [LED_COLOR_ID_YELLOW] = "yellow", [LED_COLOR_ID_IR] = "ir", + [LED_COLOR_ID_MULTI] = "multicolor", }; EXPORT_SYMBOL_GPL(led_colors); From patchwork Tue Oct 1 14:56:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 174886 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8664524ill; Tue, 1 Oct 2019 07:56:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7RgtxrQgGsa7XyhnJwSl67Ho0s/jgm7bRLp+PLRNIysr6o9kJyTf6kGtPnghMIihog68q X-Received: by 2002:a50:e613:: with SMTP id y19mr26204852edm.290.1569941818875; Tue, 01 Oct 2019 07:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569941818; cv=none; d=google.com; s=arc-20160816; b=EGtAlFQkZfn5E/kCfGqGw+rNd19qYo0qvHyYIFEPSMAaq0bbRYuOp5BcznFmjW6jbf Xb1LoRVE4XsBv7Ia3Ah8GOUahsZGhWB1oHFaW1ekXiz/KVX6sNniH4+y5Kfu53MkNxXr eR8/cfmdZwf9FzXcIF4Q58rYu8VL2BXCzOLediZn1vRbTUdC35vzmqXbLv4B9KZ5YeVh 9oFV33XtrY1hSh9A6jBe/eAbkv8Jzp6RzNIWDnf88Vk5z5WZpJzh1+PMZxE8O6kSRNec vQQMVYTXtb1dFlQ5dohISva/z0Wh1EhFxfmX3QCUF8aZK3YazhE8XTaZ0aWBaXEwRsIU 1LaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LFJY/sk3vbxhRSCXMQMK8Y5qMhwQ/+YV7Aj17cmTfjg=; b=ZT2MwJS6+jG5hH/gu1JlVD+iTPqPgVCr3U1QCqUgxhBmh02nbnuaDRHNxbSYNOftZf zrJql+BvJ33aAZoca0ehpk7i+i6pOX/H+k8Bp/dE5nmmd3y9CZ/t3tulyBYiRompzDpS CqVepLH4ndD1/YHFTabafKs+HhlNbqTlxCg/tYQ3svQz9t/A0imIFRAmPkCX5MwiB2EO TRCNt++MfSIULhZrZlBqS5O4wBQid4Yhc6UhptJKW6LrhmI2hKV1yH7VXhfGKGvVJj/m Ulv2dU1103fPNFaKgqI0PNos4kwddKti0oH97Ryv1+T98Q46eHc75QTDW+znKrgm1ihv CGqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UyghUTKL; 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 d1si9045238eds.148.2019.10.01.07.56.58; Tue, 01 Oct 2019 07:56:58 -0700 (PDT) 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=UyghUTKL; 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 S1727179AbfJAO46 (ORCPT + 1 other); Tue, 1 Oct 2019 10:56:58 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:44962 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389341AbfJAO4J (ORCPT ); Tue, 1 Oct 2019 10:56:09 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu5HE123835; Tue, 1 Oct 2019 09:56:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569941765; bh=LFJY/sk3vbxhRSCXMQMK8Y5qMhwQ/+YV7Aj17cmTfjg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=UyghUTKLTcPx2r9gsri1fasNrolJgrp98VL3/l08Q4lVleN66vm9gO2wjuxJUhwvW kXGCq36ZPLITuVtl7AfxR4PzU8HrcwMF+y7q64qLz7z9/hj/0VRYN/DXsNquvsI8RJ 1lohuu2ASjToO3tQ1zEXmEGk7+07fTBNXuEjB0ds= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x91Eu5rG052872 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Oct 2019 09:56:05 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 1 Oct 2019 09:56:05 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 1 Oct 2019 09:55:55 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu5H2044683; Tue, 1 Oct 2019 09:56:05 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v10 05/16] dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers Date: Tue, 1 Oct 2019 09:56:09 -0500 Message-ID: <20191001145620.11123-6-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191001145620.11123-1-dmurphy@ti.com> References: <20191001145620.11123-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 Introduce the bindings for the Texas Instruments LP5036, LP5030, LP5024, LP5018, LP5012 and LP5009 RGB LED device driver. The LP5036/30/24/18/12/9 can control RGB LEDs individually or as part of a control bank group. These devices have the ability to adjust the mixing control for the RGB LEDs to obtain different colors independent of the overall brightness of the LED grouping. Datasheet: http://www.ti.com/lit/ds/symlink/lp5012.pdf http://www.ti.com/lit/ds/symlink/lp5024.pdf http://www.ti.com/lit/ds/symlink/lp5036.pdf Signed-off-by: Dan Murphy --- .../devicetree/bindings/leds/leds-lp50xx.txt | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-lp50xx.txt -- 2.22.0.214.g8dca754b1e diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.txt b/Documentation/devicetree/bindings/leds/leds-lp50xx.txt new file mode 100644 index 000000000000..8a0a21f1056c --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.txt @@ -0,0 +1,148 @@ +* Texas Instruments - LP5009/12/18/24/30/36 RGB LED driver + +The LP50XX is multi-channel, I2C RGB LED Drivers that can group RGB LEDs into +a LED group or control them individually. + +The difference in these RGB LED drivers is the number of supported RGB modules. + +Required parent properties: + - compatible: + "ti,lp5009" + "ti,lp5012" + "ti,lp5018" + "ti,lp5024" + "ti,lp5030" + "ti,lp5036" + - reg : I2C slave address + lp5009/12 - 0x14, 0x15, 0x16, 0x17 + lp5018/24 - 0x28, 0x29, 0x2a, 0x2b + lp5030/36 - 0x30, 0x31, 0x32, 0x33 + - #address-cells : 1 + - #size-cells : 0 + +Optional parent properties: + - enable-gpios : gpio pin to enable/disable the device. + - vled-supply : LED supply + +Required child properties: + - #address-cells : 1 + - #size-cells : 0 + - reg : This is the LED module number. + - color : Must be LED_COLOR_ID_MULTI + - function : see Documentation/devicetree/bindings/leds/common.txt + +Required child properties only is LED modules will be banked: + - ti,led-bank : This property denotes the LED module numbers that will + be controlled as a single RGB cluster. Each LED module + number will be controlled by a single LED class instance. + There can only be one instance of the ti,led-bank + property for each device node. + +Required grandchildren properties: + - reg : A single entry denoting the LED output that controls + the monochrome LED. + - color : see Documentation/devicetree/bindings/leds/common.txt + - led-sources : see Documentation/devicetree/bindings/leds/common.txt + +The LED outputs associated with the LED modules are defined in Table 1 of the +corresponding data sheets. + +LP5009 - 3 Total RGB cluster LED outputs 0-2 +LP5012 - 4 Total RGB cluster LED outputs 0-3 +LP5018 - 6 Total RGB cluster LED outputs 0-5 +LP5024 - 8 Total RGB cluster LED outputs 0-7 +LP5030 - 10 Total RGB cluster LED outputs 0-9 +LP5036 - 12 Total RGB cluster LED outputs 0-11 + +Optional child properties: + - label : see Documentation/devicetree/bindings/leds/common.txt + - linux,default-trigger : + see Documentation/devicetree/bindings/leds/common.txt + +Examples: +led-controller@29 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,lp5024"; + reg = <0x29>; + enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>; + vled-supply = <&vmmcsd_fixed>; + + multi-led@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + color = ; + function = LED_FUNCTION_STATUS; + + led@3 { + reg = <3>; + color = ; + }; + + led@4 { + reg = <4>; + color = ; + }; + + led@5 { + reg = <5>; + color = ; + }; + }; + + multi-led@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + color = ; + function = LED_FUNCTION_STANDBY; + ti,led-bank = <2 3 5>; + + led@6 { + reg = <0x6>; + color = ; + led-sources = <6 9 15>; + }; + + led@7 { + reg = <0x7>; + color = ; + led-sources = <7 10 16>; + }; + + led@8 { + reg = <0x8>; + color = ; + led-sources = <8 11 17>; + }; + }; + + multi-led@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + color = ; + function = LED_FUNCTION_ACTIVITY; + + led@12 { + reg = <12>; + color = ; + }; + + led@13 { + reg = <13>; + color = ; + }; + + led@14 { + reg = <14>; + color = ; + }; + }; +}; + +For more product information please see the link below: +http://www.ti.com/lit/ds/symlink/lp5012.pdf +http://www.ti.com/lit/ds/symlink/lp5024.pdf +http://www.ti.com/lit/ds/symlink/lp5036.pdf From patchwork Tue Oct 1 14:56:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 174885 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8664429ill; Tue, 1 Oct 2019 07:56:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFXim5IAXuxnyOi+LGgEZ4J2ib9mB4tFNjb/9atpunbyjkSHvw702t9mI3KytD98RcmuRc X-Received: by 2002:a50:c2c2:: with SMTP id u2mr25532746edf.220.1569941813961; Tue, 01 Oct 2019 07:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569941813; cv=none; d=google.com; s=arc-20160816; b=WXb0vRepfr2N5MNLjSk11fncjwiRlfeQQ6lzwYnrQKJxUKYDvBrperLoLRNbOB/qmB uHKHbBrY99VwGAf3lmO/6yL5n0HzhKNsavhHEH9TFs7WrR2D/it46cc4uS1q9RHyK165 xIVIRicI1v4+PEG9YMoyOwJ7qghI/0VbKwkexiKiSp9RcObK1ajmvlGhExHRp5yCgY+g WLZoVgizWlV7STMH2ZDNU+qLx+PlkMoieikEPUCh0VJleyii5M1eJBFIkXJyEnMA+zmX 2b3KY7wX482qcxrq3iJxMsUxlw3W4Q+gxj6djNXa8VTR5qTyheEmnG3kk0tvgJe+yL/V V1Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/b85K9QfQmcTUjBGtiBK+Pc0IlJV0yFQsUuHQPDjQho=; b=NFctYGuWIWIJXWHBA/awg7ornytXBdpmLj6xKVTpVjwx3kN93IKTQae6PTr5GO8lHV 9GT7Fbe/12VdzCghLd5smH42P2uicfwRHeNwWx3BUvOOtqXiUQR9xh4qKY+mlanvQtz8 SXmDyHaZwBOrPk6j8qAjHuoavXvVVf1fGRVc2Bd4OjbW/2XfhzobdAISD23O+ihpabNZ jtfmBusIzXIEHl71zv5+baUm7OKPj6crriXJihEpvzKSPH3AuAQ6/Y3al50duKyuDL7B bxidrK/jxLneXXqIygzUd1pyrdcNp65pH+WERVQc3+89p8GjPCrhDL116lgDI/COs+5n jysg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CNrcWc0H; 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 a33si9744294edf.121.2019.10.01.07.56.53; Tue, 01 Oct 2019 07:56:53 -0700 (PDT) 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=CNrcWc0H; 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 S1732670AbfJAO4x (ORCPT + 1 other); Tue, 1 Oct 2019 10:56:53 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:42448 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389353AbfJAO4K (ORCPT ); Tue, 1 Oct 2019 10:56:10 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu7Qn016114; Tue, 1 Oct 2019 09:56:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569941767; bh=/b85K9QfQmcTUjBGtiBK+Pc0IlJV0yFQsUuHQPDjQho=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=CNrcWc0HrYTGnrYxmxwocjRl/RRLlfUJm1of7A1czjtOOPd9XZHP51sJAvIG/geLy vGgFm5cAEqGYwvJiCiPlOM1MK67X6suU/QQ6J2D6qopEJMqwvJRAPeuINzkgkci/hK p/ebmhtcdt/s168tWpkJ+S8EtmK9q3yMRqpULH3o= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x91Eu7G0052906 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Oct 2019 09:56:07 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 1 Oct 2019 09:55:56 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 1 Oct 2019 09:56:06 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu61K014745; Tue, 1 Oct 2019 09:56:06 -0500 From: Dan Murphy To: , CC: , , Dan Murphy , Linus Walleij Subject: [PATCH v10 11/16] ARM: dts: ste-href: Add reg property to the LP5521 channel nodes Date: Tue, 1 Oct 2019 09:56:15 -0500 Message-ID: <20191001145620.11123-12-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191001145620.11123-1-dmurphy@ti.com> References: <20191001145620.11123-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 Add the reg property to each channel node. This update is to accomodate the multicolor framework. In addition to the accomodation this allows the LEDs to be placed on any channel and allow designs to skip channels as opposed to requiring sequential order. Signed-off-by: Dan Murphy CC: Linus Walleij --- arch/arm/boot/dts/ste-href.dtsi | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) -- 2.22.0.214.g8dca754b1e diff --git a/arch/arm/boot/dts/ste-href.dtsi b/arch/arm/boot/dts/ste-href.dtsi index 6422c53f2046..53738edd741d 100644 --- a/arch/arm/boot/dts/ste-href.dtsi +++ b/arch/arm/boot/dts/ste-href.dtsi @@ -56,16 +56,21 @@ reg = <0x33>; label = "lp5521_pri"; clock-mode = /bits/ 8 <2>; - chan0 { + #address-cells = <1>; + #size-cells = <0>; + chan@0 { + reg = <0>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; linux,default-trigger = "heartbeat"; }; - chan1 { + chan@1 { + reg = <1>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; }; - chan2 { + chan@2 { + reg = <2>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; }; @@ -75,15 +80,20 @@ reg = <0x34>; label = "lp5521_sec"; clock-mode = /bits/ 8 <2>; - chan0 { + #address-cells = <1>; + #size-cells = <0>; + chan@0 { + reg = <0>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; }; - chan1 { + chan@1 { + reg = <1>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; }; - chan2 { + chan@2 { + reg = <2>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; }; From patchwork Tue Oct 1 14:56:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 174884 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8664364ill; Tue, 1 Oct 2019 07:56:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBXjTB2puv8sJs3/O2jkODTZODpBsECQDuwp3NSboRyyn1/NddK/Zv+222rPIsCsN++xGg X-Received: by 2002:a17:906:5ad8:: with SMTP id x24mr24518796ejs.107.1569941810827; Tue, 01 Oct 2019 07:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569941810; cv=none; d=google.com; s=arc-20160816; b=S95LSEla15101lSzWSDgan/BFp60dRlBdxkd8pkIvK4Bhj38juW4ThP+MyMvLfY/jA goUYRFUtWFKRvlpINqP32V+tDKBRVLQ4Nfl52D9lAXpWXDg/hwy/ymxW7MzwkasbVEhF TEepvRJr46HOQg6gF9RMSoBO8WBVCBnG80Gbk4UPZ9GJngIuiNWFMUZYy6I8vIJgPVsL hfMZlnRe8HlySWp0cs55O7dgCBNp6ii/JIQNKrZYNhbAHL8R+dt6NhsaxEli/8SxUOaf cozZ30V8KdBE5X8Pxky/2kFB7G1W3BZf7tpCwwdCfNA9tcgv0VrI5NTkuzKOA88Tatuh jQkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=B9yG4ufRS9+E8Lu+URgJWA5cmnh7iCXcWX+AN1bat4U=; b=waPu8O4BB70Nl56CKnCJKUckoslL0urU2V3Z2TsitN0/Zd0DENO6cEjpkImZCcaQtI ONFnGiXXOzzd3HSWBJ1PqhjulTatdPPyDj6lY/K5/meyVMG27PapeyeaUDkROx73+3Q1 ywbwLECEarRkHEhFEes6ZW1uZI9hz/dMBZoT5s98l7Le4VKgVCmt1b0yzTRiIU0VJksL 5G9wwF1hKsH3wwLhLLNwDoQGbqhAxouJC73UmMAoePKMUi5vznt2SY5Yedj0gkCpj2QQ bAElMIYJ6uZmNTtvMDUcgBYpbOuAbhWZO/IRMqgbq7zeLfh4PQt3aFXlm0F5yL6WRADi G35A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qRX2u1iE; 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 a33si9744294edf.121.2019.10.01.07.56.50; Tue, 01 Oct 2019 07:56:50 -0700 (PDT) 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=qRX2u1iE; 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 S2389361AbfJAO4t (ORCPT + 1 other); Tue, 1 Oct 2019 10:56:49 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:42444 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389354AbfJAO4K (ORCPT ); Tue, 1 Oct 2019 10:56:10 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu7ZM016122; Tue, 1 Oct 2019 09:56:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569941767; bh=B9yG4ufRS9+E8Lu+URgJWA5cmnh7iCXcWX+AN1bat4U=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qRX2u1iEIHx5WmtKJbf3WKD5nfRinuF7a5OYvR/2QIOk+c8sZDLuRKBXhBgsWTimM BZfzfG9bZJSDHSeNUVuPkjZ0O6+zpn1BSwnS1BC2INlpgaDX4GXw9lqq4emU9zmRX6 3vP/dQqus/hBuMVmD6h9/nu0WlUvgnb8FxzIFFbI= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x91Eu7Zf003619 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Oct 2019 09:56:07 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 1 Oct 2019 09:55:57 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 1 Oct 2019 09:56:07 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu7lj095708; Tue, 1 Oct 2019 09:56:07 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v10 13/16] leds: lp5523: Update the lp5523 code to add intensity function Date: Tue, 1 Oct 2019 09:56:17 -0500 Message-ID: <20191001145620.11123-14-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191001145620.11123-1-dmurphy@ti.com> References: <20191001145620.11123-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 Add the intensity function call back to support the multicolor framework. This function allows setting a specific brightness on a specific channel. Signed-off-by: Dan Murphy --- drivers/leds/leds-lp5523.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.22.0.214.g8dca754b1e diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index d0b931a136b9..07484fc2f715 100644 --- a/drivers/leds/leds-lp5523.c +++ b/drivers/leds/leds-lp5523.c @@ -791,6 +791,19 @@ static ssize_t store_master_fader_leds(struct device *dev, return ret; } +static int lp5523_led_intensity(struct lp55xx_led *led, int chan_num, + int brightness) +{ + struct lp55xx_chip *chip = led->chip; + int ret; + + mutex_lock(&chip->lock); + ret = lp55xx_write(chip, LP5523_REG_LED_PWM_BASE + chan_num, + brightness); + mutex_unlock(&chip->lock); + return ret; +} + static int lp5523_led_brightness(struct lp55xx_led *led) { struct lp55xx_chip *chip = led->chip; @@ -857,6 +870,7 @@ static struct lp55xx_device_config lp5523_cfg = { .max_channel = LP5523_MAX_LEDS, .post_init_device = lp5523_post_init_device, .brightness_fn = lp5523_led_brightness, + .color_intensity_fn = lp5523_led_intensity, .set_led_current = lp5523_set_led_current, .firmware_cb = lp5523_firmware_loaded, .run_engine = lp5523_run_engine, From patchwork Tue Oct 1 14:56:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 174883 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8664251ill; Tue, 1 Oct 2019 07:56:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwks7eds1sv6kMoFDzSE+XXqqAsFwmT1ZgCDF5L4zS1K3yYLPXOq22D+6+XmmDaNpFS600q X-Received: by 2002:aa7:c5c2:: with SMTP id h2mr26470723eds.260.1569941805501; Tue, 01 Oct 2019 07:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569941805; cv=none; d=google.com; s=arc-20160816; b=tWHzqSloQblxO3EPDMpCLlryRdCpgmHpmct+0ULN+deTMFBai2VkYww91pZcv2kBxj 7tCPabXZOYOfcC2EpR142P6JLnXN9NnfZpDqjre2xTVFuB8qShlCqsVzqfpn0dXj1h9Q 3bWapeMewMVtokvRl2pQpSjdWthEOgVL5hwX9hNt7/SE/K7iGtRaOi1Lid8Og4RkGQnF KOPGQt8+ymChGXVfzcPvdKhJd0/fgt5ZsnWzJa7LAOgSbSB1ZY/GaAJOR4IfRN99ygLz h0rvHoI/Ekj5e/IWsy0sQIdu5sl7OmDPP/pwPeag4w8wtK1gNHlEPHyu1O3IsWfbSBzt 3ooQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oK4HRSNfmRH4Eic+dLGHWWE/yj5s+hx6sK8hLWYxbNg=; b=HX5dyATslEOs3AhuiCIIq5Wu+rHVznrvTPG2UDDrS60zJ8fvG8biiSL+/Dx3rnSbBp c673pPvaE2nXiznTJ98Tq/v3+BHGWcjNMQlaW8e1X+SBGjpTTiTPs3GcppHrmsDSQbU+ 7KHZNCyb055wjiwf/6lQrX/HI/saFuAM6J9nxQtDYKWp/KVMDpef9SjHzhEn1e0J/Y3f 6LQYRKpGHwr+KYNJ6RLwIfZR6j6DSh+qQDdrw2kphMZ+d7H9z6pfFgUnWkYEEW0B5fnz LRAoigM8EWFb0O48KGGVMSV3auSsDzfh2Ddrdw6QvKpXc1i6w0lLXhGmPFKTOyUhNJjS 7n9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=WoNQGnZ6; 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 h48si9456711ede.31.2019.10.01.07.56.45; Tue, 01 Oct 2019 07:56:45 -0700 (PDT) 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=WoNQGnZ6; 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 S2389364AbfJAO4o (ORCPT + 1 other); Tue, 1 Oct 2019 10:56:44 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:44974 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389361AbfJAO4K (ORCPT ); Tue, 1 Oct 2019 10:56:10 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu8Fs123841; Tue, 1 Oct 2019 09:56:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569941768; bh=oK4HRSNfmRH4Eic+dLGHWWE/yj5s+hx6sK8hLWYxbNg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=WoNQGnZ62aYs179fjqqXXhhp2TRm3iTNq6zbgCW3kWRVps0IXENk4kDDzcwK9bZlM jiywlAl+0YOFTLmPnEUhDEyWZeDxbRgDf6s6TMKgV4b8ttLFpdL1pbzTPKaPAVasdG P56A3akOTeiZ182C4MzJs3xAyqx2HWgacFEW6IUU= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x91Eu7C0041392 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Oct 2019 09:56:08 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 1 Oct 2019 09:56:07 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 1 Oct 2019 09:56:07 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu7dt044750; Tue, 1 Oct 2019 09:56:07 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v10 15/16] leds: lp55xx: Fix checkpatch file permissions issues Date: Tue, 1 Oct 2019 09:56:19 -0500 Message-ID: <20191001145620.11123-16-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191001145620.11123-1-dmurphy@ti.com> References: <20191001145620.11123-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 Fix the checkpatch warnings for the use of the file permission macros. In converting the file permissions to the DEVICE_ATTR_XX macros the call back function names needed to be updated within the code. This means that the lp55xx_ needed to be dropped in the name to keep in harmony with the ABI documentation. Signed-off-by: Dan Murphy --- drivers/leds/leds-lp55xx-common.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) -- 2.22.0.214.g8dca754b1e diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index 5de4f1789a44..87bf25795c87 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -78,7 +78,7 @@ static int lp55xx_post_init_device(struct lp55xx_chip *chip) return cfg->post_init_device(chip); } -static ssize_t lp55xx_show_current(struct device *dev, +static ssize_t led_current_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -87,7 +87,7 @@ static ssize_t lp55xx_show_current(struct device *dev, return scnprintf(buf, PAGE_SIZE, "%d\n", led->led_current); } -static ssize_t lp55xx_store_current(struct device *dev, +static ssize_t led_current_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { @@ -111,7 +111,7 @@ static ssize_t lp55xx_store_current(struct device *dev, return len; } -static ssize_t lp55xx_show_max_current(struct device *dev, +static ssize_t max_current_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -120,9 +120,8 @@ static ssize_t lp55xx_show_max_current(struct device *dev, return scnprintf(buf, PAGE_SIZE, "%d\n", led->max_current); } -static DEVICE_ATTR(led_current, S_IRUGO | S_IWUSR, lp55xx_show_current, - lp55xx_store_current); -static DEVICE_ATTR(max_current, S_IRUGO , lp55xx_show_max_current, NULL); +static DEVICE_ATTR_RW(led_current); +static DEVICE_ATTR_RO(max_current); static struct attribute *lp55xx_led_attrs[] = { &dev_attr_led_current.attr, @@ -281,7 +280,7 @@ static int lp55xx_request_firmware(struct lp55xx_chip *chip) GFP_KERNEL, chip, lp55xx_firmware_loaded); } -static ssize_t lp55xx_show_engine_select(struct device *dev, +static ssize_t select_engine_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -291,7 +290,7 @@ static ssize_t lp55xx_show_engine_select(struct device *dev, return sprintf(buf, "%d\n", chip->engine_idx); } -static ssize_t lp55xx_store_engine_select(struct device *dev, +static ssize_t select_engine_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { @@ -333,7 +332,7 @@ static inline void lp55xx_run_engine(struct lp55xx_chip *chip, bool start) chip->cfg->run_engine(chip, start); } -static ssize_t lp55xx_store_engine_run(struct device *dev, +static ssize_t run_engine_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { @@ -358,9 +357,8 @@ static ssize_t lp55xx_store_engine_run(struct device *dev, return len; } -static DEVICE_ATTR(select_engine, S_IRUGO | S_IWUSR, - lp55xx_show_engine_select, lp55xx_store_engine_select); -static DEVICE_ATTR(run_engine, S_IWUSR, NULL, lp55xx_store_engine_run); +static DEVICE_ATTR_RW(select_engine); +static DEVICE_ATTR_WO(run_engine); static struct attribute *lp55xx_engine_attributes[] = { &dev_attr_select_engine.attr,