← Back to team overview

ac100 team mailing list archive

Re: Some notes concerning nvec

 

On Sun, Oct 23, 2011 at 12:58:21AM +0200, Pierre-Hugues Husson wrote:
> Hi,
> 
> I've been reading again the original nvec driver, originally to find
> how to enable resume on LID.
> I found out some stuff/bugs:
> 1. Side leds must be set to 0 and only then set to the effect we want,
> else undefined behaviour might happen
> Ex: echo 0 > brightness ; sleep 1 ; echo 7 > brightness ; sleep .2
> ;echo 1 > brightness
> and you'll get always on LED (which isn't expected.)

We should probably rewrite it to use multiple led controls, as
there are multiple LEDs AFAIK.

> 
> 2. I had a look at caps lock handling: It doesn't use linux's reported
> caps lock status which is wrong. It tries to guess by itself what
> should be the status of the led
> Ex: Enable caps lock on X, switch to terminal, led is still on, while
> caps lock is not actualy activated.
> Current code kind of tries to handle that in nvec_kbd_event, but it
> doesn't have any effect.

nvec_kbd_event is not called at all currently, that's why I hacked
in the stuff we currently have (which is better than nothing for
most workloads).

> In the example given it should shut off the led, but it doesn't...
> Also, the third value in ACK_KBD_EVENT (wtf is it called "ack"?) is
> 0x01, it could be 0x04:
> The PS2 norm specifies caps lock is 0x04, nvec headers uses 0x01, it
> seems original code uses 0x01, but we can't tell for sure because of
> nvrm_daemon.
> Either way, using 0x07, like the code in key receiver, should be fine.



> 
> 3. nvec-led has the LED_CORE_SUSPENDRESUME flag, which means leds are
> powered off on suspend.
> IMHO that totally defeats the purpose of those leds.
> What I think is typical use of those leds is: wake up every 1/2hours,
> check mails, set leds state if needed, go back to sleep.
> So this flag totally kills such a use.

Yes.

> 
> 4. nvec can wake up on the events we want, like LID, any keyboard key,
> home keyboard key, or power button.
> Current setting is wake up on any keyboard key, but not LID or power
> button (other?)
> Of course, it's all a matter of taste (although no wake up on power
> button is weird.),
> So there should be a way to configure it, but is there any standard
> linux way of doing that ?

I know, I talked to Marc about it and it was on my TODO list.


> 
> 5. I've found some weird commands:
> auto_resume (it's right after mute/unmute commands, could be related)
> value: 0x0d 0x10 0x40 0x11 argument(1byte)
> suspend 0x0D 0x10 0x59 0xE9
> resume 0x0D 0x10 0x59 0xE8

I don't know what you mean.

> 
> 6. Battery led can be software-controlled, I doubt that's of any use though.
> Likewise, there is a set_power_led() function (0x0D 0x10 0x47 0x81),
> i'm not sure what's its use, possibly to toggle power led (which could
> be useful in night)

It would be helpful to disable LEDs at night, right.

> 
> 7.Keyboard keymap can be read from nvec, also there is some uuid
> I'm not sure it's of much use, but could be nice to have (if used in
> installer for example)

I think that we want to have a completely different keymap than nvec
is going to report. We want to have F1 and friends, and we want to
have function keys for brightness/etc (which I haven't implemented
yet)

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

Attachment: pgp_xGgtdX3Fb.pgp
Description: PGP signature


Follow ups

References