From patchwork Tue Oct 1 14:56:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 174884 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8664364ill; Tue, 1 Oct 2019 07:56:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBXjTB2puv8sJs3/O2jkODTZODpBsECQDuwp3NSboRyyn1/NddK/Zv+222rPIsCsN++xGg X-Received: by 2002:a17:906:5ad8:: with SMTP id x24mr24518796ejs.107.1569941810827; Tue, 01 Oct 2019 07:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569941810; cv=none; d=google.com; s=arc-20160816; b=S95LSEla15101lSzWSDgan/BFp60dRlBdxkd8pkIvK4Bhj38juW4ThP+MyMvLfY/jA goUYRFUtWFKRvlpINqP32V+tDKBRVLQ4Nfl52D9lAXpWXDg/hwy/ymxW7MzwkasbVEhF TEepvRJr46HOQg6gF9RMSoBO8WBVCBnG80Gbk4UPZ9GJngIuiNWFMUZYy6I8vIJgPVsL hfMZlnRe8HlySWp0cs55O7dgCBNp6ii/JIQNKrZYNhbAHL8R+dt6NhsaxEli/8SxUOaf cozZ30V8KdBE5X8Pxky/2kFB7G1W3BZf7tpCwwdCfNA9tcgv0VrI5NTkuzKOA88Tatuh jQkA== 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=B9yG4ufRS9+E8Lu+URgJWA5cmnh7iCXcWX+AN1bat4U=; b=waPu8O4BB70Nl56CKnCJKUckoslL0urU2V3Z2TsitN0/Zd0DENO6cEjpkImZCcaQtI ONFnGiXXOzzd3HSWBJ1PqhjulTatdPPyDj6lY/K5/meyVMG27PapeyeaUDkROx73+3Q1 ywbwLECEarRkHEhFEes6ZW1uZI9hz/dMBZoT5s98l7Le4VKgVCmt1b0yzTRiIU0VJksL 5G9wwF1hKsH3wwLhLLNwDoQGbqhAxouJC73UmMAoePKMUi5vznt2SY5Yedj0gkCpj2QQ bAElMIYJ6uZmNTtvMDUcgBYpbOuAbhWZO/IRMqgbq7zeLfh4PQt3aFXlm0F5yL6WRADi G35A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qRX2u1iE; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-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 a33si9744294edf.121.2019.10.01.07.56.50; Tue, 01 Oct 2019 07:56:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-leds-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=qRX2u1iE; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-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 S2389361AbfJAO4t (ORCPT + 1 other); Tue, 1 Oct 2019 10:56:49 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:42444 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389354AbfJAO4K (ORCPT ); Tue, 1 Oct 2019 10:56:10 -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 x91Eu7ZM016122; Tue, 1 Oct 2019 09:56:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569941767; bh=B9yG4ufRS9+E8Lu+URgJWA5cmnh7iCXcWX+AN1bat4U=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qRX2u1iEIHx5WmtKJbf3WKD5nfRinuF7a5OYvR/2QIOk+c8sZDLuRKBXhBgsWTimM BZfzfG9bZJSDHSeNUVuPkjZ0O6+zpn1BSwnS1BC2INlpgaDX4GXw9lqq4emU9zmRX6 3vP/dQqus/hBuMVmD6h9/nu0WlUvgnb8FxzIFFbI= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x91Eu7Zf003619 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Oct 2019 09:56:07 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 1 Oct 2019 09:55:57 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE106.ent.ti.com (10.64.6.27) 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, 1 Oct 2019 09:56:07 -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 x91Eu7lj095708; Tue, 1 Oct 2019 09:56:07 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v10 13/16] leds: lp5523: Update the lp5523 code to add intensity function Date: Tue, 1 Oct 2019 09:56:17 -0500 Message-ID: <20191001145620.11123-14-dmurphy@ti.com> X-Mailer: git-send-email 2.22.0.214.g8dca754b1e In-Reply-To: <20191001145620.11123-1-dmurphy@ti.com> References: <20191001145620.11123-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@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 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.22.0.214.g8dca754b1e diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index d0b931a136b9..07484fc2f715 100644 --- a/drivers/leds/leds-lp5523.c +++ b/drivers/leds/leds-lp5523.c @@ -791,6 +791,19 @@ static ssize_t store_master_fader_leds(struct device *dev, return ret; } +static int lp5523_led_intensity(struct lp55xx_led *led, int chan_num, + int brightness) +{ + struct lp55xx_chip *chip = led->chip; + int ret; + + mutex_lock(&chip->lock); + ret = lp55xx_write(chip, LP5523_REG_LED_PWM_BASE + chan_num, + brightness); + mutex_unlock(&chip->lock); + return ret; +} + static int lp5523_led_brightness(struct lp55xx_led *led) { struct lp55xx_chip *chip = led->chip; @@ -857,6 +870,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,