From patchwork Fri Oct 18 12:25:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 176816 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp788847ill; Fri, 18 Oct 2019 05:27:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSOuW8zfUr+aad6nYoOxvBG3RcUHlKQxQdBIV6ovTkPpyAuiD4KKGKuF1W00jfriUwqAZt X-Received: by 2002:a50:8dc9:: with SMTP id s9mr9261953edh.168.1571401622775; Fri, 18 Oct 2019 05:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571401622; cv=none; d=google.com; s=arc-20160816; b=X0Dm6tBrvTZg6yy3CRnPd1KBT3VoK5VDDXeTka0bYHIRkvi9/svvNV5G8yeeFIFiow lqngK/9hqoM5p7ki2yviJ8qyLhaj4rzPCqBz+Xc0gURO7EpyMNXoEGlrDqWXzJ+K1fDi S6gEWBT4Ek5IgKbuwHMSYYxjbkqecj21MOSnftSNr7Ggna2syPczoGnfg28OzsLG+u4f 6rgIwS6C+1W0P0xdmRLkkQ0HhUTE63hBmXKXwoNrUMyX1FiBup1lixe3BrQv3p692/s9 tTmPlXxZQhMzALq4vkY+AQrOvJoRnMJ522d/9s+GkLYK34F645m7Sy0Aw26W1h8hNNHN jXvA== 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=qIVwr9pkpcECT7neqBC0u+TtvO9djbszrDToerausoI=; b=BABZRe09UQBpjD4QucBcgnk9DNQni6bD/p5FJlwoBoneY/KXfBykNqV67xtZyb/F8Q 7ajY55GTeFta5khV5EqMUvWLPDfHe2oQRZX5yfwsfnv0OLW9+ffNUj1nFBJn63afa08l 2CwbZecFVNKdjhb0PYgrxYeu56k07RhPhd8OWocmMn1wXsYgOccDO+/10MpW64zMbtwZ +KP+SQPlbaEqlUCxgFn+7BHqwQsJxE6MjJzvTGcHMQAkrj5CGnrbfeqADdSMVSiIXhhz 5PmvI7bcMzhMzU3tJL5+jAlMBDEw17FYjvbTzkH7w6/vlPtVc43yu7B8/mEVkxBIqvkv TqtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XhGqSi3p; 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 gl26si3366635ejb.17.2019.10.18.05.27.02; Fri, 18 Oct 2019 05:27:02 -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=XhGqSi3p; 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 S2633872AbfJRM07 (ORCPT + 26 others); Fri, 18 Oct 2019 08:26:59 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:40844 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2633682AbfJRM0A (ORCPT ); Fri, 18 Oct 2019 08:26:00 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9ICPvBQ013941; Fri, 18 Oct 2019 07:25:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571401557; bh=qIVwr9pkpcECT7neqBC0u+TtvO9djbszrDToerausoI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=XhGqSi3py1DAD7/WulT9WvGrSCZuTNZ9x43yc1Hi+kdm5P5EEIMNXv6MjBH9jSNvy Y/4Jn4SCOazp9KCSPJ+k5WHSInSa2hkndBQ4+s0tzu6Nd3GzFaWkBS5zYi7nxL13aI bKmsSEMbKkqLjwiqKj2ZkQskTSf/AcUKUwJgoxqc= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9ICPv60053642 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 18 Oct 2019 07:25:57 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 18 Oct 2019 07:25:49 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE106.ent.ti.com (157.170.170.36) 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, 18 Oct 2019 07:25:57 -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 x9ICPvmC073332; Fri, 18 Oct 2019 07:25:57 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v14 14/19] leds: lp5523: Update the lp5523 code to add multicolor brightness function Date: Fri, 18 Oct 2019 07:25:16 -0500 Message-ID: <20191018122521.6757-15-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191018122521.6757-1-dmurphy@ti.com> References: <20191018122521.6757-1-dmurphy@ti.com> MIME-Version: 1.0 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(+) -- 2.22.0.214.g8dca754b1e diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index 15e7051392f5..287fc4756cd1 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,