From patchwork Mon Jan 21 21:56:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 156253 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6848698jaa; Mon, 21 Jan 2019 13:57:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN6CRmogRdxUaKMuAXjW8bR5YXrmBnbEQVIEcq4K1DsBHifDK+ttgL4Bx7uTKFwRbjDpAPse X-Received: by 2002:a62:c505:: with SMTP id j5mr31113569pfg.149.1548107828933; Mon, 21 Jan 2019 13:57:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548107828; cv=none; d=google.com; s=arc-20160816; b=HpdUgfwq/4r5Gb568DQ7vog+Yud3QczUaFkbwnkrwnOamLvq0W4rk6LBoV0lD/0+JO zv9ciXZGmAKEgVT+6QSGDWtjnPe45nB6t+eU8/6+J+L0ReO4MomhQM0e4u/l1rL1KNtA 1k31I8iuF59pZxVbskCav4GC3X4orRm7ANfnXf6HapgWL+jvSqOPzIjfYMR9vvdQCFAU mBRQi2nMcBsG3qG+DcDO8zW1tnfBnbUNLftLWeXo75xbm9WxtdMz3z+WEAnZWl5KQNSq HrXj0f9gG1HOtxXLE7X5oK7TbXyoTvRhDVjyyrfaqFZoQX8hbOl4B4Ahzu7Xtmr5Wuks Yvow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=oE6JTng7GXWVBOpU7moCy0rA+O+hF2ItSllxLsVgDb8=; b=ql1sXiP67B1r1UJnlXS4VVHK+boReTmVV/LVTrUiomRva8MT8PKf3+3taOlLxNKS8A O9rzH4Br0RXztA40/QGHsbQ5YCSxiAZznv0uqGDtSBP+gx99L9wK624V6Rnc7ufof4+z CumdxaGqKx19p5eQfEG43IwcA1bTDdGYNKHlf5cEaLk1elVgLoK0bE3ucMk9AASzdTI7 dmtFDqR7Nj1/VT0yZ7C5NEBCb4CVX7Y7aPFwOBLSMSI4w7+NP2xP0Q3Qv+dyWmDW6FU6 YksBvkwhRXpUcxHgix+EE8AFRxW1jolbRp4jyy9Fpmk8nYZsm6vavNiMWQreRjLaclUv wZmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mhS6E9rL; 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 9si14124932plc.40.2019.01.21.13.57.08; Mon, 21 Jan 2019 13:57:08 -0800 (PST) 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=mhS6E9rL; 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 S1727457AbfAUV5I (ORCPT + 1 other); Mon, 21 Jan 2019 16:57:08 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:59156 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727513AbfAUV5H (ORCPT ); Mon, 21 Jan 2019 16:57:07 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0LLv2wK095324; Mon, 21 Jan 2019 15:57:02 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1548107822; bh=oE6JTng7GXWVBOpU7moCy0rA+O+hF2ItSllxLsVgDb8=; h=From:To:CC:Subject:Date; b=mhS6E9rLQTfdQLdDutze3wYAhNdR3GPyOgvbDyxnTjVDOUooyNT46otWGpKFJRcVe eoxsAVBbZDr3sm8TGbITgdOrIMrfIXuHYiD+cxRT1ej0UwzUrnJjSOjm1Bh/WAOknD y/xhbJdAcPxE6ofmPLqQ9HRQpU+TwGym+QQdxlrE= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0LLv22t125597 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Jan 2019 15:57:02 -0600 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 21 Jan 2019 15:57:02 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 21 Jan 2019 15:57:02 -0600 Received: from legion.dal.desgin.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0LLv2SU020699; Mon, 21 Jan 2019 15:57:02 -0600 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.78.123]) by legion.dal.desgin.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id x0LLv1U20719; Mon, 21 Jan 2019 15:57:02 -0600 (CST) From: Dan Murphy To: CC: , , , Dan Murphy Subject: [PATCH 0/6] [RFC] Simplified RGB class Version 1 Date: Mon, 21 Jan 2019 15:56:53 -0600 Message-ID: <20190121215659.31125-1-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 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 All I want to present one alternative to Pavels requirements and the proposal by Vesa. I have not written all the documentation around this as I expect this not to be taken as it is written and I fully expect that the files or implementation will change. It is an overly simplified RGB class definition that provides basic files to the user. It exposes a common color file that takes in 3 decimal numbers from 0-255 in a "red green blue" format like in Vesa's proposal. It also exposes the 3 RGB files red, green and blue with decimal input from 0-255. I have ported 2 working drivers to this class, while retaining backwards compatibility, and provided a dummy test file that can be called that registers and the color writes and reads are basically no-ops. The LP50xx driver and cpcap driver on the Droid 4 were converted. When writing 255 to the red, green and blue files to either device I was able to achieve the color white without any correction. Writing "255 255 255" > color produced the same. I am going to get the LP5523 device from TI and try to port that over as well so Pavel can use the N900 against the framework. Finally I plan on porting these 3 devices to Vesa's proposal and I will modify the RGB class to Pavel's requirements. This will give us 3 different implementations that can be tested against real hardware. I am posting this as a RFC only and I have it available on the latest mainline kernel on a public facing repo if you want to pull that instead. Repo: http://git.ti.com/git/ti-analog-linux-kernel/dmurphy-analog.git git://git.ti.com/ti-analog-linux-kernel/dmurphy-analog.git Branch: rgb_framework_v1 Dan Dan Murphy (6): DO NOT MERGE:dt and defconfig leds: RGB Framework: Introduce a simple RGB framework leds: rgb: Add a dummy test file to test the RGB framework dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers leds: lp50xx: Add the LP50XX family of the RGB LED driver leds: cpcap: Use the RGB framework for Droid4 .../devicetree/bindings/leds/leds-lp50xx.txt | 143 ++++ Documentation/leds/leds-lp50xx.txt | 36 + arch/arm/boot/dts/am335x-bone-common.dtsi | 58 +- .../arm/boot/dts/motorola-cpcap-mapphone.dtsi | 8 +- arch/arm/configs/omap2plus_defconfig | 7 +- drivers/leds/Kconfig | 20 + drivers/leds/Makefile | 3 + drivers/leds/led-class-rgb.c | 313 +++++++ drivers/leds/leds-cpcap.c | 291 ++++++- drivers/leds/leds-lp50xx.c | 769 ++++++++++++++++++ drivers/leds/leds-rgb-fw-test.c | 177 ++++ drivers/mfd/motorola-cpcap.c | 8 +- include/linux/led-class-rgb.h | 89 ++ 13 files changed, 1906 insertions(+), 16 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/leds-lp50xx.txt create mode 100644 Documentation/leds/leds-lp50xx.txt create mode 100644 drivers/leds/led-class-rgb.c create mode 100644 drivers/leds/leds-lp50xx.c create mode 100644 drivers/leds/leds-rgb-fw-test.c create mode 100644 include/linux/led-class-rgb.h -- 2.20.1.98.gecbdaf0899