Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp48846ybp; Tue, 8 Oct 2019 13:50:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKInlP2/U8L8xBjvq6YBQ+SMq+0brSH2s+24YyB5t7FbTB++uVER7Lf7wFAT0HYTHj/FNR X-Received: by 2002:a17:906:c7c6:: with SMTP id dc6mr31041342ejb.123.1570567850930; Tue, 08 Oct 2019 13:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570567850; cv=none; d=google.com; s=arc-20160816; b=Zn7Qe+xsPaL5RmrsGLUzLPXUsmg5TQp2hrAn+U3+G04RYSZTrMH0Hz2CqEe65ALEKi MSwr5jBCdFZwjGQGYzFbTu47DGoQSKuc5NHXdyEIvOTiKiNKy5nQWgBDEKXGdLCYvw8l mackMzj908LtnICZNwUZ7+QR8al3lOev4xF5mYaik15eIGKTjpcSbidrawEJWVMfsyyo JoA6JcHopUv0Cl2MnJHtJJ5n7e5jw605qTw7vQy1tJMFyGsLKDaPqhegM8wIRBNE+Dr5 wGoG6NsbY7NvxzG5Y1LVrHJRIJZywW7mqlwmtSdNu82mFigCoeV2XiWnP1+1knKJPQF7 u0Fg== 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=t6ZN8MsoaN09y80TS8iaHGApS9NVGVswvlApmF+sfMA=; b=RgHFZRikCCtjFRLWyoAueydJ1zUZNTctduSbHgJa2Kwi7J0FMTcRJXBF2j2UVV6kCI mVZqe3LByFhRawsZ4CHh/fJMLuTpeca3MucOXS4RZiT+JCCpM/VHBsQsYh3IyLQvMQoN mFUs54svEhj0kR2sY7Kf+huxBYBgYxbYcBGSmpwVMulL8FLsTAsLKyfCAyZ39XbMgNlU piVcbdZrgJaKqFK2seYZTVF0swazS+m4XQHX3drHufp2t3HvT4URMUAsj4EKMUfQJ4VL 7d4MF+/oNOoJLtI7zn8CUKESEssEy7uDCqgK74vqOorlweknwlhtG+6T57bluXL/Y9fw GvAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="LT/nDEAR"; 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 h18si18899ejx.68.2019.10.08.13.50.27; Tue, 08 Oct 2019 13:50:50 -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="LT/nDEAR"; 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 S1731310AbfJHUtD (ORCPT + 99 others); Tue, 8 Oct 2019 16:49:03 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:43378 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731122AbfJHUsY (ORCPT ); Tue, 8 Oct 2019 16:48:24 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x98KmMx3092492; Tue, 8 Oct 2019 15:48:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1570567702; bh=t6ZN8MsoaN09y80TS8iaHGApS9NVGVswvlApmF+sfMA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=LT/nDEARqicZ77dsH+MQKji9VW+iKHwrXlQKKww9AVG4lMcDqWjf/wBJEhgYRhRfG A/S8P7vLAZaE48wGe9l55v6299N0ZcYVGwvsMQnxneHoutiN9EljwEZXzdtSopf0Lu e1e/i3NvWGD9/SInAnqkcnoC8jQNZn1icC0H0p0s= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id x98KmM43110747; Tue, 8 Oct 2019 15:48:22 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 8 Oct 2019 15:48:19 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE103.ent.ti.com (10.64.6.24) 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; Tue, 8 Oct 2019 15:48:21 -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 x98KmLgX066693; Tue, 8 Oct 2019 15:48:21 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v11 13/16] leds: lp5523: Update the lp5523 code to add intensity function Date: Tue, 8 Oct 2019 15:47:57 -0500 Message-ID: <20191008204800.19870-14-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191008204800.19870-1-dmurphy@ti.com> References: <20191008204800.19870-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 intensity function call back to support the multicolor framework. This function allows setting a specific brightness on a specific channel. 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 d0b931a136b9..5d6002e4d657 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_led_intensity(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_component[i].output_num, + led->color_component[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, + .color_intensity_fn = lp5523_led_intensity, .set_led_current = lp5523_set_led_current, .firmware_cb = lp5523_firmware_loaded, .run_engine = lp5523_run_engine, -- 2.22.0.214.g8dca754b1e