Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp897909ybp; Fri, 11 Oct 2019 06:11:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyF3CTGmOh73Kn8RvMgOi2XbuYp3eZtiHpwRdi7fBoiFNllIXKvBiR2bKlS8FKLxt25Ix0p X-Received: by 2002:a17:906:6bcd:: with SMTP id t13mr13622654ejs.133.1570799483476; Fri, 11 Oct 2019 06:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570799483; cv=none; d=google.com; s=arc-20160816; b=z4dAk8on+7u9YcTeyl5rZ8i/UJCmIZa0iA8eXdmQLWG0JPH3btj2QMXibb7dWl6jDX KYO48N6gflclYAMLohkW2d/APeXf1FFcl1axadPFOj6ocqIGsDVgGGRJuxBQfCG3P5b3 f0opKWxUrKNPlkbcUS6uS8eZ7Bc5xFbhtKTxIpYgZdBAQr174gC5KZDcson1pKMH/iqG HlCkIvsqCWxaLICSy+sSSyjvnrIdyZfrQZKCQKHSq6pKef9nDc+y9sBUHc9/3Vq1nGd+ 9vcErjvEH4UdO8jYVjn2tIWfA+kcy3ywlGQ7I4L9unPMk4PxQYJZL8vdst4vPELby9dY hd2w== 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=t6ZN8MsoaN09y80TS8iaHGApS9NVGVswvlApmF+sfMA=; b=iN4DCnT1TrV8pTUZjUtH3RLtPoP1mVYWoEaOl/JaRA9n7tXnCIcM8S6JV/p95WJyuv 2jCUe7eQxNrAe5M9IcEcfx5p/hKihV4J/TgMv6g+LOuJI5bOOzjouoCQ0gm+5fwQHhc/ F5+FZxjXG2hsh9GHoRHR7Y73YEeZClv4tlTKOmxDFm6KmCo5cXKlGFHTfTn/EzBjsEwk SGiQDGAsL/Wcp2QpYhiredpFNj1gIwpZU21/UOwxPn7YJ/Rp/9Ju4NWYtYp5xtf+r/AH L+BnRQOqt5l4XAzK/HWkVT7p0cig1j3qRAjnRioUbhQbwjL2Gsnnf1zcXDjQ944T30yV SsjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aFXqroca; 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 k16si5177839ejo.7.2019.10.11.06.10.59; Fri, 11 Oct 2019 06:11:23 -0700 (PDT) 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=aFXqroca; 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 S1728503AbfJKNIG (ORCPT + 99 others); Fri, 11 Oct 2019 09:08:06 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:36950 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728234AbfJKNHY (ORCPT ); Fri, 11 Oct 2019 09:07:24 -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 x9BD7Lfb078501; Fri, 11 Oct 2019 08:07:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1570799241; bh=t6ZN8MsoaN09y80TS8iaHGApS9NVGVswvlApmF+sfMA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=aFXqrocaWhtcW8gM8qVvZ1m+4C1YY3Usxp+H+GJ90inetE42D5D0TLHd/TbDEA8fk DIB7eYYhIWVjX0aRp56LKFrfZE8b4ejmaQUtpUDoU3ODBX9FNQjSm9VhqSB62XyDo8 DevuUOC68QOkfHx4miiBN3mB3C9z/1K0CRqWIb9o= 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 x9BD7L8h094143; Fri, 11 Oct 2019 08:07:21 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) 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; Fri, 11 Oct 2019 08:07:17 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) 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; Fri, 11 Oct 2019 08:07:17 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9BD7L3K105242; Fri, 11 Oct 2019 08:07:21 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v12 13/16] leds: lp5523: Update the lp5523 code to add intensity function Date: Fri, 11 Oct 2019 08:06:54 -0500 Message-ID: <20191011130657.4713-14-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191011130657.4713-1-dmurphy@ti.com> References: <20191011130657.4713-1-dmurphy@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 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 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index d0b931a136b9..5d6002e4d657 100644 --- a/drivers/leds/leds-lp5523.c +++ b/drivers/leds/leds-lp5523.c @@ -791,6 +791,25 @@ static ssize_t store_master_fader_leds(struct device *dev, return ret; } +static int lp5523_led_intensity(struct lp55xx_led *led) +{ + struct lp55xx_chip *chip = led->chip; + int ret; + int i; + + mutex_lock(&chip->lock); + for (i = 0; i < led->mc_cdev.num_leds; i++) { + ret = lp55xx_write(chip, + LP5523_REG_LED_PWM_BASE + + led->color_component[i].output_num, + led->color_component[i].brightness); + if (ret) + break; + } + mutex_unlock(&chip->lock); + return ret; +} + static int lp5523_led_brightness(struct lp55xx_led *led) { struct lp55xx_chip *chip = led->chip; @@ -857,6 +876,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, -- 2.22.0.214.g8dca754b1e