lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190115222223.GA17363@amd>
Date:   Tue, 15 Jan 2019 23:22:23 +0100
From:   Pavel Machek <pavel@....cz>
To:     Jacek Anaszewski <jacek.anaszewski@...il.com>
Cc:     Dan Murphy <dmurphy@...com>, linux-leds@...r.kernel.org,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
        dachaac@...il.com, robh+dt@...nel.org
Subject: Re: [PATCH v2 2/2] leds: lp50xx: Add the LP50XX family of the RGB
 LED driver

Hi!

> >+The 24-bit RGB value passed in follows the pattern 0xXXRRGGBB
> >+XX - Do not care ignored by the driver
> >+RR - is the 8 bit Red LED value
> >+GG - is the 8 bit Green LED value
> >+BB - is the 8 bit Blue LED value
> >+
> >+Example:
> >+LED module output 4 of the LP5024 will be a yellow color:
> >+echo 0xe6de00 > /sys/class/leds/lp5024\:led4_mod/color
> >+
> >+LED module output 4 of the LP5024 will be dimmed 50%:
> >+echo 0x80 > /sys/class/leds/lp5024\:led4_mod/brightness
> >+
> >+LED banked RGBs of the LP5036 will be a white color:
> >+echo 0xffffff > /sys/class/leds/lp5036\:led_banked/color
> 
> This part with example cans remain in Documentation/leds if you
> >like.

Does it actually work like that on hardware?

Is it supposed to support "normal" RGB colors as seen on monitors?

Because 100% PWM on all channels does not result in white on hardware
I have.

> >+	} else {
> >+		led_offset = (led->led_number * 3);
> >+		red_reg = priv->mix_out0_reg + led_offset;
> >+		green_reg = priv->mix_out0_reg + led_offset + 1;
> >+		blue_reg = priv->mix_out0_reg + led_offset + 2;
> >+	}
> >+
> >+	red_val = (mix_value & 0xff0000) >> 16;
> >+	green_val = (mix_value & 0xff00) >> 8;
> >+	blue_val = (mix_value & 0xff);
> 
> I've been rather thinking about space separated list of decimal
> "red green blue" values, but maybe this way it will be less
> controversial. Let's if there will be other opinions.

We support maximum brightness > 255, so space separated is certainly
better option than this.

But...

I believe we should have a reasonable design before we do something
like this. There's no guarantee someone will not use lp50xx with just
the white LEDs for example. How will this work? Plus existing hardware
already uses three separate LEDs for RGB LED. Why not provide same
interface?

(Oh and don't try to say "sysfs is slow", without numbers).

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ