Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3197571ybc; Thu, 14 Nov 2019 05:34:48 -0800 (PST) X-Google-Smtp-Source: APXvYqx+1qtLLEeUaVkDoOy1Z962ZFijZZ79kJk/icSzQz6dcuev0J9CqosXgn1yt8LEhkxEbn5a X-Received: by 2002:aa7:c716:: with SMTP id i22mr1239029edq.237.1573738488808; Thu, 14 Nov 2019 05:34:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573738488; cv=none; d=google.com; s=arc-20160816; b=YfyyoBmH2EhD6zXo15AeGtU1wv4BN6wBImmfI/nA766KF/YfOa8rnfUWZYex064SZr 2mTtzXy7sQgyEedtiCk6RbM+ewFsHLgeRTuoskVdsARWEGr48+nQyKX6cm2JXKGd8uYa 5PHWLIzv0yaDqd3M3VkJRJdLiznCrSPBc122CE+wADql8IKyug9iUf6x5uLUoavwlp6d jUHGwcYd6lT46O+CEyH/p+eRMGuzZ3unRkgY7alzpRes8xMYKfA03/2IE56yHGY6t8Ll BcVTJ5U2wUWsRyraX4eSzt/DZrUxWL76CPxPc+0lesOuWOAk+gbwRiTW1nuzyGKlvgQ/ VdYg== 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=5oPRgd9y4fLZAUSx3Us0YBQ1cAUc/cf63XhWxENhBFk=; b=qoHiK63y+Cl6LNxt52MOopuH16EqBhJ9ndp1AbOnE7reukm1GcongSoJH858aZbCcd RwRyCm/eDJsb17Iy18SZl47yHBXT85664J0zJJpo+spT3nmtXUTENr43kP8Evrb4TQtU ePOI2cXfkEQ/RH6PU0ASIHuxyh9QDdzxrLqLxxuk046yaT9vKF2Ws2Ki3YgSKh4Kyll3 meRq5dFVuUZHsNY/9h97Ztt6joKhJpi5Gcx1UHX6redlQAweQiunOfsbA08HlWlqbPNg PZ9du613V+y4bmX3YI8tBtqCKSH9ncBfYurewpe3hDaWT8hD3PXvrTiAqZJIWp8Q3oPQ WFsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ZaMJK7yj; 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 p21si4102289edc.305.2019.11.14.05.34.24; Thu, 14 Nov 2019 05:34:48 -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=ZaMJK7yj; 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 S1726613AbfKNNcp (ORCPT + 99 others); Thu, 14 Nov 2019 08:32:45 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:48226 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726980AbfKNNcn (ORCPT ); Thu, 14 Nov 2019 08:32:43 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xAEDWeYA007676; Thu, 14 Nov 2019 07:32:40 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1573738360; bh=5oPRgd9y4fLZAUSx3Us0YBQ1cAUc/cf63XhWxENhBFk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ZaMJK7yjSnY+/X3mdQThJ1etWwZ4VdMxwEt0ZRE8JeW3TWs4nBsv+dW4JKDx37wD0 LlHpBfGk9Ta0OYRPqFtXx1X9pYsjJjTp4mc0M9wfSAz3CBttBsVacvcnsdMXdgNrGZ axxkGCyv/1b63YnXAbun2BoNJufiBpjpkAUipA9Q= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xAEDWe1E064188 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 14 Nov 2019 07:32:40 -0600 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 14 Nov 2019 07:32:40 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 14 Nov 2019 07:32:40 -0600 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 xAEDWdi7081228; Thu, 14 Nov 2019 07:32:39 -0600 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v17 15/19] leds: lp5521: Add multicolor framework multicolor brightness support Date: Thu, 14 Nov 2019 07:30:19 -0600 Message-ID: <20191114133023.32185-16-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191114133023.32185-1-dmurphy@ti.com> References: <20191114133023.32185-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 function allows setting the brightness across grouped LED channels in a single call. Signed-off-by: Dan Murphy --- drivers/leds/leds-lp5521.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index 6ff81d6be789..f8bdd55e8349 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c @@ -349,6 +349,25 @@ static int lp5521_run_selftest(struct lp55xx_chip *chip, char *buf) return 0; } +static int lp5521_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, + LP5521_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 lp5521_led_brightness(struct lp55xx_led *led) { struct lp55xx_chip *chip = led->chip; @@ -490,6 +509,7 @@ static struct lp55xx_device_config lp5521_cfg = { .max_channel = LP5521_MAX_LEDS, .post_init_device = lp5521_post_init_device, .brightness_fn = lp5521_led_brightness, + .multicolor_brightness_fn = lp5521_multicolor_brightness, .set_led_current = lp5521_set_led_current, .firmware_cb = lp5521_firmware_loaded, .run_engine = lp5521_run_engine, -- 2.22.0.214.g8dca754b1e