Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1026839ybz; Wed, 29 Apr 2020 13:40:14 -0700 (PDT) X-Google-Smtp-Source: APiQypIWUcaCtxPUB3G87lqS+9Punk909XG/jtHqgioWyuhGLh5jQ2fj74uMouX/oVXlRkjcDD6Z X-Received: by 2002:a17:906:1751:: with SMTP id d17mr4327475eje.314.1588192814513; Wed, 29 Apr 2020 13:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588192814; cv=none; d=google.com; s=arc-20160816; b=GX2FiKaTxxVLnyQLjeJ2HgpD6qlssl2+s8dD14kspvQY+JkbPRAfmlfg0TrGdWjlPI z38XbOTx633ZjYKYbaIE2tulw9v7gLx4NAcefhGtT6PBuLRxlEyIA6rlH4UjvzvJcfs7 yr8Mu1CdzewGXBiSnZs9OoUkBAjN7PgKFnET6HXMWV7Wx+gyu6yB2Ex3MSUuCDMnaT69 RBILEE3bsaSBhBme+qVRhnJ3U1VVdPqyO/tfOku2XMXo5rsbvNakARggtLk+Ik2O1aHl yfJMVs8XA29Y4xcVcrvkWqztsY2zgi2DRx1rvYFyG9ldDpo4ydqjK3Xz6EekmZY38ZkD BYww== 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=RYnuxLvhzPXJaQvjYIkqPLVeMM27YjkF+XrGkCZQjw0=; b=LbwzzQFvXUizoW9Wa+4qJjFxbci2HR+E7Wxs8BMq40+RjdziAJLdqudWdXDOT/DWgI 9Ghpk5v1WtrG6KuNdXbyM/L0DhOgnkCapr9TzSiqsaaRaWewzLs/IkYyaTiuJPpxdery GxtvN5WUQNzKjerKycnx4m7P0/b9zCb+WFeogoR6qaSxtSYK4YFaNXR/4uVaJKNKoQQ7 mSuNUiwlpLLN8i9VEuz/BIGcw3RWdm0m23nH0MWwGZA1sqF5qUjsGMY5iuJhvdcSPrb4 QK7yWVfO1JT4MPTtVzFdhHy4LGNklRg0/YJL+4iP6GJIRIlf5eSJxsYWIn4M8DTXprXG oMzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ULmju7CZ; 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 a35si4267122edf.377.2020.04.29.13.39.50; Wed, 29 Apr 2020 13:40:14 -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=ULmju7CZ; 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 S1727879AbgD2UhP (ORCPT + 99 others); Wed, 29 Apr 2020 16:37:15 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:54908 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727090AbgD2UhJ (ORCPT ); Wed, 29 Apr 2020 16:37:09 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 03TKb6oL118307; Wed, 29 Apr 2020 15:37:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1588192626; bh=RYnuxLvhzPXJaQvjYIkqPLVeMM27YjkF+XrGkCZQjw0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ULmju7CZgqKv9x4YccNKJhwJSqa0qQvZkOwbA1LgoUzC4ZwPzHQu3luEH0oEX+y4k XMVZb1F0Ix5IgGfw93YngqGFrt5RpOXBpjsW62fUn2I8c4zrARSN0g8kZ0E8DK2dqi j/TAyIilAF44DMZq6fTbCqP/ufHDKTt2YY+UWDHE= 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 03TKb6TJ115075; Wed, 29 Apr 2020 15:37:06 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) 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.1979.3; Wed, 29 Apr 2020 15:37:06 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE101.ent.ti.com (157.170.170.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:06 -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 03TKb5eB082214; Wed, 29 Apr 2020 15:37:06 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v23 12/16] leds: lp5523: Update the lp5523 code to add multicolor brightness function Date: Wed, 29 Apr 2020 15:28:12 -0500 Message-ID: <20200429202816.26501-13-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 call back allows setting brightness on grouped channels in a single function. Acked-by: Pavel Machek Acked-by: Jacek Anaszewski 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..9776dc72a764 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_colors; i++) { + ret = lp55xx_write(chip, + LP5523_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 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.25.1