From patchwork Fri Oct 11 13:06:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 175941 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp730642ill; Fri, 11 Oct 2019 06:08:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzuoQxmlRP3W6nJvUZGYQNvbCSdADOVOZXVzr7QNK3Ir7QhE37+k727tzcgV0zBWhR7CAp X-Received: by 2002:a05:6402:68b:: with SMTP id f11mr13072753edy.173.1570799285140; Fri, 11 Oct 2019 06:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570799285; cv=none; d=google.com; s=arc-20160816; b=bxsFATVlgesdAzHgAcYUxgM62PMY/DsoDqPY0bI6mf95aTHQsKT0Jm//SnywKjGYEM dZAAY7LQOrs8E1InG1MbCvU6UJUiSibRwkzl3Y2TWhR1E+mb4tM8IZl4S1xEvRVuqLgV yEiDOpOS/IPnJVW6Z8P3r1McuNSa1KwT2VRcHBsW4bJKfcGPmTdfSRg30cq5K7Hbdrsz pkk4VcZ04Mp3/cRM5LW2EdV7IFA46WHkqXg3EULASDcGHNnsYxao2XUwWaJfSKVjpgHX Nk+rh4nKRBTFK9GWj+civhYjDTAOBKBH57FF2+FlzOd6usN+7pHWyTztn54wOZ6VVJb1 GyLA== 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=DWlAPkPyGPLMlgt95vLmSAWY5AQ+1wT9MtJDSpag9us=; b=vNshhenMiXeRYwKAnl0QB3fNwAMe408VxQ0woWI7L0vXkBnAw08FDzf2G15Q7/mfuQ 8S1VrhTSGel19hX0Oe+n0oQPIOmG5khgooWagjeaLrTnlNFlaBh/nFikmELo8Gk2xTnL t0/nR9jvwUhH4Nlvc+35ha7OBo9aNgrZgSSFWAZbIKermhURgilqO5/nGNmJ5OUSYlAF YnldJeKSRgwAnoakR7DFJFD5HA5+Ee4cEHKg8nSbBUDhkNqyiebvVLa0i526Ics1C1mR RwrYfyx8VS0j9299U/VCMFpe8QYMoX9ozxmP2V9wWAUThQy5xSgdeQQ49mVFSQNRGo5e Ei7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=QH0MLhbz; 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 e11si5325418ejr.383.2019.10.11.06.08.04; Fri, 11 Oct 2019 06:08:05 -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=QH0MLhbz; 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 S1728494AbfJKNIE (ORCPT + 21 others); Fri, 11 Oct 2019 09:08:04 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:41596 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728240AbfJKNHY (ORCPT ); Fri, 11 Oct 2019 09:07:24 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9BD7LoQ033385; Fri, 11 Oct 2019 08:07:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1570799242; bh=DWlAPkPyGPLMlgt95vLmSAWY5AQ+1wT9MtJDSpag9us=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=QH0MLhbz4+0Mi7ppOSIPYNEHXBgj9dw1hZQAHTuRc2db4l6ZLgQtrwQfht1XFmGd8 Iqz1ebNj2nwn1ut1QQINl21A99pQ4XZnZVc2Y33zLdbH+WBsH1Y8gtZYY4xTKW3v13 9ERuCf/T+v1Nt4de1boSWzod2nCKg7iaPs3Ut88I= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9BD7L5B078723 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Oct 2019 08:07:21 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 11 Oct 2019 08:07:17 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE112.ent.ti.com (157.170.170.23) 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, 11 Oct 2019 08:07:17 -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 x9BD7Ldn118581; Fri, 11 Oct 2019 08:07:21 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v12 14/16] leds: lp5521: Add multicolor framework intensity support Date: Fri, 11 Oct 2019 08:06:55 -0500 Message-ID: <20191011130657.4713-15-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191011130657.4713-1-dmurphy@ti.com> References: <20191011130657.4713-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 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-lp5521.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.22.0.214.g8dca754b1e diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index 6f0272249dc8..05731f405c9a 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_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, + LP5521_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 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, + .color_intensity_fn = lp5521_led_intensity, .set_led_current = lp5521_set_led_current, .firmware_cb = lp5521_firmware_loaded, .run_engine = lp5521_run_engine,