mbox series

[0/6,RFC] Simplified RGB class Version 1

Message ID 20190121215659.31125-1-dmurphy@ti.com
Headers show
Series Simplified RGB class Version 1 | expand

Message

Dan Murphy Jan. 21, 2019, 9:56 p.m. UTC
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