Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1026074ybz; Wed, 29 Apr 2020 13:39:22 -0700 (PDT) X-Google-Smtp-Source: APiQypK1gXjUrJOgwqcZdaC7Kz26IzBaIL9eGL8a5RE42N4MeM83eKWvlY7bIEqAPBrB6Qzk0uh7 X-Received: by 2002:aa7:c492:: with SMTP id m18mr4163835edq.346.1588192762443; Wed, 29 Apr 2020 13:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588192762; cv=none; d=google.com; s=arc-20160816; b=MvT/I6Rneu1PoUuPIzsEOHDiIIHIGztnhkJftAUxZgaNCOnNmqkpgjXuGpI4HuXAET l43Pj39zTRnuCtBzNlT1tnaNcwsDCugGe6NtyDMnVL1T5Qv9KyjyTmLqp68j1olRs0kf fIUmlSN8s117/Qa+C+b8Ins153xTjda8fCsjNArXk6YHhCnHv++XESHQXaVJSw32gyX8 65EdRm81jni30zhg+QmJNLOWgqsWuOG9+UJmMOlhckAux2bFwC297wzzhQvOP+IMpZdG zWHfhjGr//RVYkSTN7ViccRu2curWxy1zIg3op8f5DBe82VrmqmEqkRoqgzDGLZ7E1/R qAQQ== 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=hU0UrhDRPRA0pqk/Um1ifkWePzRWQi7omOheTm/otqo=; b=CoDonbZ1X7GBygMS/nzwXd/VONyIcBjuO8lwKDmwbVLsWUJh/5HBRxFN+8r3yl1aKp TOg6gVAPkdT/UenhYBSwF+FXfU3tbPaTZwgNxkh0UgROjlvIhIgrjL88P8fXPxgYFvay s0MMMV5mvoCKwcer6cATlEt8mdCEoiVWCFyqvETTHZWmC7Ukjmt+1B7BYC6gsmVZ85m1 55hMjZU7GiHFK4Rjx4UMCq2nTrgTaR6oLsqlQ99D4BlvY1AzsVOBQhQX5xv/PFZWZlXr tmDTQdveDFOXGwX/D23sxBCk3mDLIC3/sv/3F0nxHW6PnrcPctYKL9wPexgNrupmKTqT NgvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BSJzcUXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id n20si4572780ejr.443.2020.04.29.13.38.59; Wed, 29 Apr 2020 13:39:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BSJzcUXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727911AbgD2UhV (ORCPT + 99 others); Wed, 29 Apr 2020 16:37:21 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:33202 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbgD2UhK (ORCPT ); Wed, 29 Apr 2020 16:37:10 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 03TKb7FD054772; Wed, 29 Apr 2020 15:37:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1588192627; bh=hU0UrhDRPRA0pqk/Um1ifkWePzRWQi7omOheTm/otqo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BSJzcUXnzohHeUAnxgS84IsdGH+FrFzzKSxX1ONG2u6eQvIen8QBaVOno1K2GO3d7 WMU2V7HP3J8g30FagZDhSTc0XtvxPdKWQE+gZZ8NMZfrWrgvhWzICN+o9I2CoGi1tg XbSsbZRq4jHeSiUb9/uVfmQ+e9MiftB5XMm5v9v4= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 03TKb7KK115126; Wed, 29 Apr 2020 15:37:07 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) 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.1979.3; Wed, 29 Apr 2020 15:37:07 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) 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.1979.3 via Frontend Transport; Wed, 29 Apr 2020 15:37:07 -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 03TKb6CU017400; Wed, 29 Apr 2020 15:37:07 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v23 13/16] leds: lp5521: Add multicolor framework multicolor brightness support Date: Wed, 29 Apr 2020 15:28:13 -0500 Message-ID: <20200429202816.26501-14-dmurphy@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200429202816.26501-1-dmurphy@ti.com> References: <20200429202816.26501-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. Acked-by: Pavel Machek Acked-by: Jacek Anaszewski 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..ef8c3bfa8f3c 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_colors; i++) { + ret = lp55xx_write(chip, + LP5521_REG_LED_PWM_BASE + + led->mc_cdev.subled_info[i].channel, + led->mc_cdev.subled_info[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.25.1