From patchwork Tue Oct 1 14:56:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 174878 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8663900ill; Tue, 1 Oct 2019 07:56:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpkAEhQRB+HH3wB8SOWsJVvMiz677+K63S3Oe8rnFmyeg5agYH1JgqgsZZ8lzFK5UJU8hn X-Received: by 2002:a50:ef12:: with SMTP id m18mr25932388eds.18.1569941786668; Tue, 01 Oct 2019 07:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569941786; cv=none; d=google.com; s=arc-20160816; b=MrweMqyGrcAK9UgsgDY2G/oaOBNmcPsD2OqMrfRACrctyCd4Dp7A/oegGudehoPlF3 eX8W+g3u9FbEkciS+E85uxIELcuGhrZkZGhZwhzpH9RZloc5VKVMMAYcfx0BPTL75BNy 20jP7wXVbgKdSYIbKzZffgknF6tIzSjcwcCVDaaFkh61pvNehEFlznGiTWPo08C+nqMm vDFKUGQscyozJD5k+mect8Umgw4NwZz2bmKS209u8o5D/eCg/h4b0btz26xAWSXdFPuC 4FyywmrGcH1y14mzCNpW4pgRC17K8DKZb+4ol760q+FXYqX3vAdA2d34veW3V5mb2ddz 0Uiw== 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=nsf4YP2sZo8d84vyGJUp6at9/u0D7qF2v2EbeTjm9Hk=; b=o7uBY5bZ6PyXnraLrakdgJndNv+VjAA2yqahe2Qku2LoqDko2twbrDCghmQ1BtAkNl 0GnF6PDlY5lGPe00s6M94eC5JE7NcjzQzjr2ugjgMyGJ7WjVl0N6PUOOjyOFhxq3X28q 27Cdnh5OQDQfDO99IQ1YQXnxlO8ZRSY4k6Qntv/qitGqo4lMSIGmupl+tq9FbdyeHaX0 RB0bMOIcYjZjgxHBcBruaX7Zj3UBC67yHjqYvB2x60KUjS/EHuKB877hPNixQt8WvRr9 7rqGcIvQsPONrD0OZt3gi0BcL3Z0rj7VfpPhUx7C6hwdy0rCxESkPcKVCCxIgY/VcAx7 2mbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="kyjbC/9c"; 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 8si9548673edz.299.2019.10.01.07.56.26; Tue, 01 Oct 2019 07:56:26 -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="kyjbC/9c"; 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 S2389412AbfJAO4O (ORCPT + 27 others); Tue, 1 Oct 2019 10:56:14 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:50134 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389358AbfJAO4K (ORCPT ); Tue, 1 Oct 2019 10:56:10 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x91Eu7CC007787; 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=nsf4YP2sZo8d84vyGJUp6at9/u0D7qF2v2EbeTjm9Hk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kyjbC/9clBuantdAMj87BRoO1r+0etTLfGOAZE9Ac+iyIGJVaGX+ZXazeopWOU89A oI7ZbuT8ahv/xtcUdNoku5qu+pzuP+LBXsR++XSa7i0jif6YP5z4xeRhek70dbAVar h4OHQb+AFTixtOi/mmFdB9Wn31Cmkz0xzdgl5Rpo= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x91Eu7CG003630 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Oct 2019 09:56:07 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE111.ent.ti.com (157.170.170.22) 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 fllv0040.itg.ti.com (10.64.41.20) by DLEE111.ent.ti.com (157.170.170.22) 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:55:57 -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 x91Eu7eD014770; Tue, 1 Oct 2019 09:56:07 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v10 14/16] leds: lp5521: Add multicolor framework intensity support Date: Tue, 1 Oct 2019 09:56:18 -0500 Message-ID: <20191001145620.11123-15-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-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 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.22.0.214.g8dca754b1e diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index 6f0272249dc8..9c71f0fe7bf8 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c @@ -349,6 +349,19 @@ static int lp5521_run_selftest(struct lp55xx_chip *chip, char *buf) return 0; } +static int lp5521_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, LP5521_REG_LED_PWM_BASE + chan_num, + brightness); + mutex_unlock(&chip->lock); + return ret; +} + static int lp5521_led_brightness(struct lp55xx_led *led) { struct lp55xx_chip *chip = led->chip; @@ -490,6 +503,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,