← Back to team overview

ac100 team mailing list archive

Some notes concerning nvec

 

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.)

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.
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.

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 ?

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

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)

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)


Follow ups