Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3977635ybg; Mon, 28 Oct 2019 23:49:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWXpqbwSGYuLfnCwGXr9DNWu73492XLGoy4YbtRje8QZjsx6cbze7Ryfxdv0Tg2Ztf/LEN X-Received: by 2002:a17:906:1f8b:: with SMTP id t11mr1621305ejr.191.1572331752983; Mon, 28 Oct 2019 23:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572331752; cv=none; d=google.com; s=arc-20160816; b=qxVNhC7OzPPncp2BkbJvwRWu26b/vdlJcABh+vqQbBz1Lma2FPuRdL2UBLRC/cP0dM 63y8l3H3tI8cMGVvRTIb5mBy03v25YZkoHUswTXvVsrUbj8CW/12lvDmffnTyqtS/muo VdqnSaITqj/u5GA111kw+yMrOdTGmZ96yHkGY46PRbUO+Pbesb+2+BBhM7Acr1MD0fDk jXVCZ/NVocVMtCiB4Or9dv4lI98vvjOXaAaBZxLdZIsKzppHH53H2FaXVnU96pQplSvX gy/CPNYpKamCyQvxaX8QnnUghFapmuYYX9dOoypOTWLIxKkGe9pmS6o91NZ/dVE/R25H xt2g== 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=g7UL6cJtcQdVkWq2mI0FrMGiupDZ0AbMcCYXx+3Cao4=; b=O51ZAVct8cMqy/jAm38ljvZ6LrmOCMR3eBmdF6JSMUb8ABtzOfqTfj+d/aZNTB2La5 cFVc+G84Xt73EWf+PeIHu+AML/YNunLjyq3JfL/leTwPcuQRg3sLuDG7YOCLThFpTAJA may/C8qZ863I8JhR8pyZ3k7Etd8pkpEnlTBfnUDjXu6O1uohdETS8xLxDmEXfVI8+LfI FPcvTnOcFbi9i0iUpaKhHUqjdXR2yjNOKO9Kun/+r7ShpVYI/pwLkds5h4M7v0OgN3p2 zc96UMTOwVxZNlSnKZ4q6go9o8Hypd5b5gyhQHUw24Rz7oTFNFzvvAoRUWiOBJ1IdZ0p wk3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RfTIGGTQ; 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 g19si9210521edb.280.2019.10.28.23.48.48; Mon, 28 Oct 2019 23:49:12 -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=RfTIGGTQ; 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 S1727895AbfJ1Sim (ORCPT + 99 others); Mon, 28 Oct 2019 14:38:42 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:43368 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727847AbfJ1Sil (ORCPT ); Mon, 28 Oct 2019 14:38:41 -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 x9SIccRk066065; Mon, 28 Oct 2019 13:38:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1572287918; bh=g7UL6cJtcQdVkWq2mI0FrMGiupDZ0AbMcCYXx+3Cao4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=RfTIGGTQskUddENG1zSPDWsxJuy02u9LcQwJwFlRMQJypbP1l2cY4Ub2DB8kYYi4P 8NtvfWft4fbVqW/ttu9FeBwYxN1/Yi+o+p2xsTLRy8Yntj4YV5hc3tnO3pUSfQg8J5 CazTuGH3mTR5Csg4SDknWE5sjjRGF0dzZZMYOdtI= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9SIccuA097495; Mon, 28 Oct 2019 13:38:38 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 28 Oct 2019 13:38:38 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE114.ent.ti.com (157.170.170.25) 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; Mon, 28 Oct 2019 13:38:26 -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 x9SIcbPL107173; Mon, 28 Oct 2019 13:38:37 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v15 14/19] leds: lp5523: Update the lp5523 code to add multicolor brightness function Date: Mon, 28 Oct 2019 13:36:24 -0500 Message-ID: <20191028183629.11779-15-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191028183629.11779-1-dmurphy@ti.com> References: <20191028183629.11779-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 multicolor brightness call back to support the multicolor framework. This call back allows setting brightness on grouped channels in a single function. 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 b076c16df9ab..609288077917 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_multicolor_brightness(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_components[i].output_num, + led->color_components[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, + .multicolor_brightness_fn = lp5523_multicolor_brightness, .set_led_current = lp5523_set_led_current, .firmware_cb = lp5523_firmware_loaded, .run_engine = lp5523_run_engine, -- 2.22.0.214.g8dca754b1e