Jump to content

UPDATED 20.12. GenericBrightness.kext


ivik
 Share

674 posts in this topic

Recommended Posts

Hi Scorpy22,with your advice, I succeed. The SUN shows, and with ivik's kext, the slider works. Now I can use Fn+Delete/Pause to control the brightness :)

Now I still want to map the brightness hotkeys to Fn+up/down. Ivik, do you have another voodoops2 kext? With that one you provided before, my keyboard cannot work.

Thanks you,man. You really do a great job!

 

Edit:

The voodoops2 kext works, but here is a big problem as you mentioned before, Fn+Up/Down donot emit scancodes, nothing happens when I press Fn+Up/Down, though i can get the scancodes of ScrLK&Pause.

Link to comment
Share on other sites

What is your grpahics from ioreg? POP, GFX0 or?

 

Hello, thank you very much for taking a look at this.

The thing is that i am not sure.

 

ioreg |grep -i p0p

returns:

 

| | +-o P0P2@3 <class IOPCIDevice, id 0x10000018f, registered, matched, active, busy 0 (7040 ms), retain 11>

| | +-o P0P1@1E <class IOPCIDevice, id 0x10000019b, registered, matched, active, busy 0 (72 ms), retain 9>

 

but grepping for -i gf

returns nothing.

If i use ioregexplorer, i do see though P0P2 but also, P0P3 (with also pegp, VGA, CRT, HDMI and LCD), and i also see: GFX0

with a bunch of DD01, DD02 etc which seem to reference PCI0, GFX0, so i am confused.

 

does it make sense to you?

Link to comment
Share on other sites

:D

Right now I have 16 brightness levels, plus the 0 level.

 

That's awesome!! Only 8 are defined in dsdt. Auto dimming is working?

What about under windows, 8 levels or?

 

 

@weizh126

That is problem, since apple brightness keys are just normal keys, and software handless brightness management.

On my lap, brightnes keys emmits scancodes and change brightness always.

 

@kellis

find display0 and then go up and you'll see what is your graphics.

I looked your dsdt, and found a lot of graphics, so i don't know which metjods shoul i copy.

Link to comment
Share on other sites

You mean in 64bit mode the PS2NUB is needed? I download the voodoops2 source from the link you provided. As that author said, the PS2NUB is not necessary, but it only works in 32bit . But with another voodoops2controller, I can use the appleps2nub,too, and the two kexts work very well in 64bit. But I don't have the source.

 

I want to assign Home(Fn+PgUp) and End(Fn+PgDn) to the brightness hotkeys. And here is the scancodes

Home(Fn+PgUp)

ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0x47
ApplePS2Keyboard: ADB key code 0x73 down
ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0xc7
ApplePS2Keyboard: ADB key code 0x73 up

End(Fn+PgDn)

ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0x4f
ApplePS2Keyboard: ADB key code 0x77 down
ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0xcf
ApplePS2Keyboard: ADB key code 0x77 up

 

so I edit the voodoops2keyboard.cpp with this

 NX_KEYTYPE_CAPS_LOCK,   0x39,
	NX_KEYTYPE_HELP,		0x72,
	NX_POWER_KEY,		   0x7f,
	NX_KEYTYPE_MUTE,		0x4a,
	NX_KEYTYPE_SOUND_UP,	0x48,
	NX_KEYTYPE_SOUND_DOWN,  0x49,
	NX_KEYTYPE_BRIGHTNESS_UP,		0x90,// ADDed by myself
	NX_KEYTYPE_BRIGHTNESS_DOWN,		0x91,// ADDed by myself

and this

0x00,0xe0,0x47, //90 Main Brightness Up
	0x00,0xe0,0x4f, //91 Main Brightness Down

and in appleps2toadbmap.h, I make these changes

 
0x90,   // e0 47  Home	//convert Home to Brightness Up
0x91,   // e0 4f  End   //convert End to Brightness Down

Is it correct? Or I miss something important?

When I compile, it throws this error

Jam is deprecated and has been removed; targets that use Jam must be upgraded to native targets. For more information on doing this, consult the Xcode documentation.

I don't know why.The Xcode version is 3.2.4, and in Snow Leopard 10.6.5.

Thanks.

Link to comment
Share on other sites

Yeah. I compiled just intel 32/64 and no missing symbols. But you said that driver wasn't auto loaded.

 

Maybe changing IODisplay.cpp from tiger could fix that. getIntegerRange is from there.

No, It gives KP at Tiger, so I have to make porting more careful.

But for Snow 10.6.5 I can't get it loading at boot. Only manual dunno why.

Is it loading automatically for you?

 

 

About PS2 look my investigations

Link to comment
Share on other sites

Does it work in 64bit mode, if so could you tell me where you found the source code ?

 

Thanks

Hi Scorpy22, I donot have the source. You can find that kext here voodoops2controller

I use both this kext and appleps2nub, they work well in 64bit mode.

 

Edit:

judging from the date, this link is later, but this one is only in 32bit mode, so I am also confused.

Link to comment
Share on other sites

No, It gives KP at Tiger, so I have to make porting more careful.

But for Snow 10.6.5 I can't get it loading at boot. Only manual dunno why.

Is it loading automatically for you?

 

 

About PS2 look my investigations

 

Yes, it does. Nobody reported that it doesn't load at boot.

 

I know how to modify brightness keys with progress bar and changing brightness in voodoops2.(ADB=90,91)

But can't compile VoodooPS2 for 64... i feel so stupid right now. Any hints, sources? :unsure:

 

I was thinking about adding scancodes to plist for brightness maping.

Link to comment
Share on other sites

Yes, it does. Nobody reported that it doesn't load at boot.
Something wrong with my system. Will check.
I know how to modify brightness keys with progress bar and changing brightness in voodoops2.(ADB=90,91)

But can't compile VoodooPS2 for 64... i feel so stupid right now. Any hints, sources? :)

 

I was thinking about adding scancodes to plist for brightness maping.

I can compile my sources to 64bit

About PS2 look my investigations
Link to comment
Share on other sites

I finally managed to compile VoodooPS2 32/64 bit.

AppleACPIPS2Nub.kext must also be installed.

GenericBrightness is also updated, since i missed one index.

 

Mapped keys are for these vendors:

acer
up e04e e059 e06e
down e06f

dell
up e006
down e005

hp
up e017
down e012

lg
up e078
down e077

samsung
up e008
down e009

 

Would you be willing to give out the source you have for voodoo with these modifications?

about to check these out to see if they work as was just about to post an issue i was having

Link to comment
Share on other sites

@Scorpy22 - Thank you so much for your work on Nvidia. My Vostro 3500 now behaving wonderfully, complete with auto-dim on battery.

Nice one!

;)

 

@Ivik, thanks too for all the work you have done on this thread that kick started a lot of thought on brightness.

Link to comment
Share on other sites

You also have native brightness?

 

Would you be willing to give out the source you have for voodoo with these modifications?

about to check these out to see if they work as was just about to post an issue i was having

 

http://forum.voodooprojects.org/index.php/topic,304.0.html

 

How to map is is explaned in this topic.

What is issue? With voodoops2 or my driver?

Link to comment
Share on other sites

ok so the new files almost fixed my issues with up and down keys

if i reboot i can up the brightness but if i go down its like it locks in and goes to 0

currently the way its working for me is on the Pause key with or without Fn and the Num Lk only with Fn pressed

tried remapping the keys with voodoo ps2 and didnt change anything.

brightness worked before on up and down but not native brightness.

here is my current layout and where they are mapped in voodooPS2:

up arrow
ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0x48
ApplePS2Keyboard: ADB key code 0x7e down
ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0xc8
ApplePS2Keyboard: ADB key code 0x7e up

with fn
ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0x6
ApplePS2Keyboard: Unknown ADB key for PS2 scancode: 0x6

down arrow
ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0x50
ApplePS2Keyboard: ADB key code 0x7d down
ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0xd0
ApplePS2Keyboard: ADB key code 0x7d up

with fn
ApplePS2Keyboard: PS/2 scancode 0xe0
ApplePS2Keyboard: PS/2 scancode 0x5
ApplePS2Keyboard: Unknown ADB key for PS2 scancode: 0x5


pause 
ApplePS2Keyboard: PS/2 scancode 0xe1
ApplePS2Keyboard: PS/2 scancode 0x1d
ApplePS2Keyboard: PS/2 scancode 0x45
ApplePS2Keyboard: ADB key code 0x71 down
ApplePS2Keyboard: PS/2 scancode 0xe1
ApplePS2Keyboard: PS/2 scancode 0x9d
ApplePS2Keyboard: PS/2 scancode 0xc5
ApplePS2Keyboard: ADB key code 0x71 up   <-- Mapped to F15 and pause (brightness up)

with fn
ApplePS2Keyboard: PS/2 scancode 0xe1
ApplePS2Keyboard: PS/2 scancode 0x1d
ApplePS2Keyboard: PS/2 scancode 0x45
ApplePS2Keyboard: ADB key code 0x71 down
ApplePS2Keyboard: PS/2 scancode 0xe1
ApplePS2Keyboard: PS/2 scancode 0x9d
ApplePS2Keyboard: PS/2 scancode 0xc5
ApplePS2Keyboard: ADB key code 0x71 up  <-- Mapped to F15 and pause (brightness up)


numlk
ApplePS2Keyboard: PS/2 scancode 0x45
ApplePS2Keyboard: ADB key code 0x47 down
ApplePS2Keyboard: PS/2 scancode 0xc5
ApplePS2Keyboard: ADB key code 0x47 up  <-- Mapped to Num Lock

with fn
ApplePS2Keyboard: PS/2 scancode 0x46
ApplePS2Keyboard: ADB key code 0x6b down
ApplePS2Keyboard: PS/2 scancode 0xc6
ApplePS2Keyboard: ADB key code 0x6b up  <-- Mapped to Scroll Lock (brightness down)

 

it seems as 71 is brightness up and 6b is going to brightness down

sort of confused as to where to go at this point

seems more of a voodoo issue not on your driver all of that is working perfectly for me

Link to comment
Share on other sites

@Ivik,

Yes native brightness now with the gfx string injection plus basic pnlf device......

fn+scr lk = brightness down (with sun menu), fn + pause = brightness up.

post-255812-1291928064_thumb.png

post-255812-1291928176_thumb.png

Interesting is that this is same string as Scorpy22, but EDID is not the same.

Link to comment
Share on other sites

You don't map keys to Scroll/Pause. You map scancodes for up/down to 90/91.

 

this is what i currently have in mine

 VoodooPS2Keyboard.cpp
	 0x00,0xe0,0x06, //90 Main Brightness Up
	 0x00,0xe0,0x05, //91 Main Brightness Down
.....
	 NX_KEYTYPE_BRIGHTNESS_UP,	   0x90,		// brightness up
	 NX_KEYTYPE_BRIGHTNESS_DOWN,	 0x91		// brightness down

 

ApplePS2ToADBMap.h
 0x91,   // e0 05   fn+down to brightness down
 0x90,   // e0 06   fn+up to brightness up

 

I assume that was correct to do or am i missing something

what was stated in the code is the default voodoo mapping it has from when i was getting the scancodes

Link to comment
Share on other sites

 Share

×
×
  • Create New...