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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 28 Jun 2008 20:52:25 +0300
From:	Riku Voipio <riku.voipio@....fi>
To:	Martin Michlmayr <tbm@...ius.com>
Cc:	Richard Purdie <rpurdie@...ys.net>, linux-kernel@...r.kernel.org,
	buytenh@...tstofly.org
Subject: Re: LEDs: how to handle gpios that control brightness for all LEDs

On Sat, Jun 28, 2008 at 05:31:09PM +0200, Martin Michlmayr wrote:
> I have a device that has various gpios that correspond to the colours
> (blue, red) of various LEDs.  They only accept 0/1, not the actual
> brightness.  However, there are two other gpios that can be used to
> control the brightness (of all LEDs): gpio V_LED 5V is bright, gpio
> V_LED 3.3V is dimmed and if neither of these two gpios are set, all
> LEDs stay off.

> Can I simply export these brightness gpios to userland or would it be
> better to handle the brightness setting in the kernel so that setting
> e.g. 100 to a LED would automatically set the V_LED 3.3V gpio and 255
> would set V_LED 5V.  If so, how should this be done?

There is a enum led_brightness, which defines LED_HALF and LED_FULL. You
would need a custom brightness function. Leds-gpio driver would need to
be extended for it. The main problem with this approach is the
unexpected effect for enduser, that adjusting brighntess of one led
affects all of them.

> Second, the LEDS class sets all gpios to off by default.  This is bad
> in my case because if neither of the brightness gpios (3.3V or 5V) are
> on, the SATA lights won't be shown either.  Is there a way to specify
> in the platform code that one gpio should be turned on by default?

default-on trigger is probably the easiest way.

-- 
"rm -rf" only sounds scary if you don't have backups

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ