Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp897338ybp; Fri, 11 Oct 2019 06:10:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHbZAbYpy5x027Ry+A5prBscARbitFQ6sIXfwYu+MiQGBa9iGt1k4/tO1vRKCRDRyIlLLE X-Received: by 2002:a17:906:e2c4:: with SMTP id gr4mr13691717ejb.89.1570799457873; Fri, 11 Oct 2019 06:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570799457; cv=none; d=google.com; s=arc-20160816; b=Ow4gFry3mphUl+vmaMsMScr26ZSgdoJ/nGLvvhkTBGy4tROS6e1EHAB4u0vAg9winT /w/EygaDmlB0F+tHgnr2veFhZJx5O/YhMUBoCcn8gJ0kSWQlSKozxYROKson235PxTL1 91nrI/+IWZRN2zU4KByaTV86SDAFzAgMrnOSdvN5hmb1YtJZg+xuCJh07w4XKmyXXb7C i8xNhlsgwvZC5g6E4cph0yn1RzsOj1uZHuoZgSSiATDzJ2uVWlnBWPxsCshDdxbmvh5q tR+cu9XeAwGUi45To21XGQSlJJc90lLqdMTIbJM4wsHOSG2A5CK6OTn9JpCH2hTdzoaN yusA== 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 n19si5186119edo.172.2019.10.11.06.10.33; Fri, 11 Oct 2019 06:10:57 -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 S1728488AbfJKNID (ORCPT + 99 others); Fri, 11 Oct 2019 09:08:03 -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 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-lp5521.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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, -- 2.22.0.214.g8dca754b1e