sony-laptop on VAIO TT help request
Subsystems (2)
G'day all,
I have a sony Vaio TT notebook. It works reasonably well with the sony-laptop kernel module excepting the following items
- No control over the optical drive power state
- No control over the "battery care" function in the embedded controller
- No control over the "quick charge" function
All three of these functions are sub-functions of the SNY6001 method call, just the same as the rfkill functions.
I've reverse engineered all three of them with the assistance of some damaged windows drivers and software. I'd like to add these functions into the sony-laptop module, but I've absolutely no idea where to start.
I can use the rfkill code as a working example to get me started on getting access to the required bits in ACPI, so I suppose I need some targeted questions to get any usable response.
1) The optical power functions are completely different from the current implementation (where specific method calls are made). I can't really figure out the best way to make the function I need have the same interface as the legacy functions "cd-power" sysfs file. Advice or ideas would be welcome.
2) Is there any precedent for how I might attempt to implement an interface to the battery care and quick charging functions?
Quick charge is easy, it's just a boolean, but the battery care is a bit more curly. On my machine it's relatively easy. It has 4 settings (off, 50%, 80%, 100%) and various combinations of bits make it behave the same way. On off is just the LSB of the control byte, however the user space application leads me to believe there may be the possibility of individually setting these bits on batteries in machines that have more than one. I don't really want to paint myself into a corner, but then I don't really know what I'm doing anyway.
It would help _heaps_ if someone with a vaio that has (A) The battery care function, and (B) more than one place a battery can plug in, could send me a DSDT to examine.
Help, ideas or advice more than welcome.
Regards,
Brad
Quoted 9 lines · Brad Campbell
G'day all,
I have a sony Vaio TT notebook. It works reasonably well with the sony-laptop kernel module excepting the following items
- No control over the optical drive power state
- No control over the "battery care" function in the embedded controller
- No control over the "quick charge" function
Quoted 7 lines
All three of these functions are sub-functions of the SNY6001 method call, just the same as the rfkill functions.
I've reverse engineered all three of them with the assistance of some damaged windows drivers and software. I'd like to add these functions into the sony-laptop module, but I've absolutely no idea where to start.
there are patches already floating around, you can take a look here
http://www.absence.it/vaio-acpi/source/patches/
the code is making its way into the kernel.
ciao
Signature · 2 lines
mattia :wq!
Quoted 3 lines · Mattia Dongili
there are patches already floating around, you can take a look here
http://www.absence.it/vaio-acpi/source/patches/
the code is making its way into the kernel.
Hrm.. next time I guess I'll ask before breaking out the debugger!
Ta :)
Il 30/06/2011 17:52, Brad Campbell ha scritto:
Quoted 7 lines · Mattia Dongili
Quoted 4 lines
there are patches already floating around, you can take a look here
http://www.absence.it/vaio-acpi/source/patches/
the code is making its way into the kernel.Hrm.. next time I guess I'll ask before breaking out the debugger!
Hello,
could you please provide us your DSDT and the exact model string of your TT?
Thanks
Hi Marco,
Quoted 3 lines · Marco Chiappero
Quoted 1 line
Quoted 1 line
could you please provide us your DSDT and the exact model string of your TT?
I looked a bit through the patch and I see that it is restricted to MM and (forgotten the model number). I have a VGN-Z11 which has also a turn on/off optical drive, a shock sensor etc.
I would be interested in trying out some of these new things and see if they can work in the Z11, too.
(btw, I also take care for the sony-laptop-zseries variant of the kernel module where you can turn off and on the nvidia card, and also the led of the speed-stamina switch is controlled. After I have tried your patches I will try to merge my patches back into yours.)
Best wishes
Norbert
------------------------------------------------------------------------
Norbert Preining preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
OK, so ten out of ten for style, but minus several million for good thinking, yeah?
--- Douglas Adams, The Hitchhikers Guide to the Galaxy
Il 01/07/2011 11:50, Norbert Preining ha scritto:
Quoted 9 lines
Hi Marco,
Quoted 3 lines · Marco Chiappero
Quoted 1 line
Quoted 1 line
could you please provide us your DSDT and the exact model string of your TT?
I looked a bit through the patch and I see that it is restricted to MM and (forgotten the model number).
MM? What does it stand for?
Quoted 2 lines
I have a VGN-Z11 which has
also a turn on/off optical drive, a shock sensor etc.
This last one is interesting because, from the other DSTDs I have seen, I suspect your notebook to have handle 0x0113, an handle that allows to enable/disable an unknown feature, is it the HDD protection?
Quoted 3 lines
(btw, I also take care for the sony-laptop-zseries variant of the kernel module where you can turn off and on the nvidia card, and also the led of the speed-stamina switch is controlled.
This is interesting too. Ok, let's not speak about the multiplexer methods, let us speak about handle 0x0128, related to the Hybrid GFX feature. I have never done a deep analysis, maybe you can help here. First of all, newer VPCZ1 models come with a few more methods, dealing with the screen brightness level, HSC5, HSC6, HSC7. Then:
- HSC0 returns the event reason (1 switch position change? what about 2,3,4?)
- HSC1 returns some state bits (what about their meaning?)
- HSC2, HSC3, HSC4?
Moreover:
Field (ECF2, ByteAcc, Lock, Preserve)
{
Offset (0xF1),
HPWR, 1, <-- ?
HLMX, 1, <-- ?
HCMM, 1, <-- ?
DLED, 1, <-- discrete GFX led
ILED, 1, <-- integr. GFX led
ALED, 1, <-- auto GFX led
Offset (0xF2),
SWPS, 1, <-- ?
HPOK, 1, <-- ?
HHPD, 1, <-- HDMI related
DHPD, 1, <-- DVI related
ATSW, 1 <-- auto switching related
}What does handle 0x0128 aim to provide?
Quoted 12 lines · Marco Chiappero
Il 30/06/2011 17:52, Brad Campbell ha scritto:
Quoted 7 lines · Mattia Dongili
Quoted 4 lines
there are patches already floating around, you can take a look here
http://www.absence.it/vaio-acpi/source/patches/
the code is making its way into the kernel.Hrm.. next time I guess I'll ask before breaking out the debugger!
Hello,
could you please provide us your DSDT and the exact model string of your TT?
http://www.fnarfbargle.com/private/110704_dsdt/tt.dsdt
The Model is a VGN-TT15GN
My dsdt has been patched to recognise a new wireless card but is otherwise unmodified. Everything appears to work but I'll be adding a WWAN card and swapping the Wifi card in the next week or two, so we'll see how that goes.
The patch I was pointed at earlier seems to pretty much activate everything.
brad@bklaptop:~$ sudo grep . /sys/devices/platform/sony-laptop/* /sys/devices/platform/sony-laptop/als_backlight:213 /sys/devices/platform/sony-laptop/als_backlight_levels:0x07 0x0c 0x0f 0x15 0x22 0x3c 0x58 0x8d 0xd5 /sys/devices/platform/sony-laptop/als_defaults:0x05 0xaa 0x00 0x55 0x6e 0x01 0x23 0x02 0x08 0x04 0x32 0x00 0x00 /sys/devices/platform/sony-laptop/als_kelvin:0 /sys/devices/platform/sony-laptop/als_lux:0.00 /sys/devices/platform/sony-laptop/als_managed:0 /sys/devices/platform/sony-laptop/als_power:0 /sys/devices/platform/sony-laptop/battery_care_limiter:1 /sys/devices/platform/sony-laptop/battery_highspeed_charging:0 /sys/devices/platform/sony-laptop/bluetoothpower:0 /sys/devices/platform/sony-laptop/fanspeed:17 /sys/devices/platform/sony-laptop/lid_resume_control:0 /sys/devices/platform/sony-laptop/modalias:platform:sony-laptop /sys/devices/platform/sony-laptop/odd_power:1 /sys/devices/platform/sony-laptop/thermal_control:1 /sys/devices/platform/sony-laptop/thermal_profiles:3 /sys/devices/platform/sony-laptop/touchpad:1 /sys/devices/platform/sony-laptop/uevent:DRIVER=sony-laptop /sys/devices/platform/sony-laptop/uevent:MODALIAS=platform:sony-laptop /sys/devices/platform/sony-laptop/wwanpower:0
No manual fanspeed control. bluetoothpower does not seem to do anything. I don't have wwan installed yet, so I can't test wwanpower but I would have expected that to be controlled via rfkill.
I don't seem to be able to get the power consumption down below about 7W though. With Windows I can get it below 6W. I'll keep fiddling.
Interesting point. Windows sets up the graphics card in 16 bit mode to reduce power consumption. With X in 16 bit mode I seem to get about .5-.7W higher power consumption than in the default 24bit mode.
Il 04/07/2011 11:19, Brad Campbell ha scritto:
Quoted 10 lines
brad@bklaptop:~$ sudo grep . /sys/devices/platform/sony-laptop/* /sys/devices/platform/sony-laptop/als_backlight:213 /sys/devices/platform/sony-laptop/als_backlight_levels:0x07 0x0c 0x0f 0x15 0x22 0x3c 0x58 0x8d 0xd5 /sys/devices/platform/sony-laptop/als_defaults:0x05 0xaa 0x00 0x55 0x6e 0x01 0x23 0x02 0x08 0x04 0x32 0x00 0x00 /sys/devices/platform/sony-laptop/als_kelvin:0 /sys/devices/platform/sony-laptop/als_lux:0.00 /sys/devices/platform/sony-laptop/als_managed:0 /sys/devices/platform/sony-laptop/als_power:0
If you want to enjoy the ALS driven backlight control (I see here disabled) you should also compile and run the daemon at http://git.zx2c4.com/sony-acpid/
Quoted 1 line
No manual fanspeed control. bluetoothpower does not seem to do anything.
That because the SPIC device is still present but probably unused (can we avoid to initialize it?) since everything goes through the SNC device. I don't know if models using both the SNC and SPIC devices exist. Mattia?
Quoted 2 lines
I don't have wwan installed yet, so I can't test wwanpower but I would have expected that to be controlled via rfkill.
Right.
Quoted 2 lines
I don't seem to be able to get the power consumption down below about 7W though. With Windows I can get it below 6W. I'll keep fiddling.
Try using the autodimming feature and try turning off the optical device and maybe the touchpad (control files in /sys/devices/platform/sony-laptop/ should be more or less self-explanatory but ask if you need). I can't say much about this, sorry.
Hi Marc,
sorry for the silence, I was overly busy with a state exam on Japanese and some presentations.
Quoted 4 lines · Marco Chiappero
Quoted 2 lines
I looked a bit through the patch and I see that it is restricted to MM and (forgotten the model number).
MM? What does it stand for?
TT I meant. But patching the kernel and running your module I see at least that there is support for battery_care_limiter and some others. On my VGN-Z11 I get:battery_care_limiter lid_resume_control subsystem@ uevent
bluetoothpower modalias thermal_control wwanpower
driver@ odd_power thermal_profiles
fanspeed power/ touchpad
in /sys/devices/platform/sony-laptop.
What I am missing is the shock protector, there is a sensor built in.
Quoted 3 lines
This last one is interesting because, from the other DSTDs I have seen, I suspect your notebook to have handle
0x0113, an handle that allows to enable/disable an unknown feature, is it the HDD protection?
How can I check that?
Quoted 7 lines
This is interesting too. Ok, let's not speak about the multiplexer methods, let us speak about handle
0x0128, related to the Hybrid GFX feature. I have never done a deep analysis, maybe you can help here. First of all, newer VPCZ1 models come with a few more methods, dealing with the screen brightness level, HSC5, HSC6, HSC7. Then:
- HSC0 returns the event reason (1 switch position change? what about 2,3,4?)
Currently we are not evaluating HSC0 at all, I am not sure about its function. only HSC1 is used to query the speed/stamina switch. Furthermore, the path of HSC1 is different on different modules
_SB.PCI0.LPC.SNC.HSC1 (VGN) and _SB.PCI0.LPCB.SNC.HSC1 (VPC)
Not much more is used actually, but turning on/off the nvidia (secondary gpu) and the speed/stamina led by hooking into
_SB.PCI0.OVGA._DSM (VGN) and _SB.PCI0.P0P2.DGPU._DSM (VPC)
with various function indices (2 -> led, 3 -> gpu off).
Quoted 1 line
What does handle
0x0128aim to provide?
No idea..
If anything what I said makes sense to you and you need more information, please let me know. I can hack the module code and dump acpi etc whatever might be useful for you.
Best wishes
Norbert
------------------------------------------------------------------------
Norbert Preining preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
it's at times like this, when
I'm trapped in a Vogon airlock with a man from Betelgeuse,
and about to die from asphyxiation in deep space that I
really wish I'd listened to what my mother told me when I
was young.'
`Why, what did she tell you?'
`I don't know, I didn't listen.'
--- Arthur coping with certain death as best as he could. --- Douglas Adams, The Hitchhikers Guide to the Galaxy
Il 12/07/2011 08:21, Norbert Preining ha scritto:
Quoted 4 lines
Hi Marc,
sorry for the silence, I was overly busy with a state exam on Japanese and some presentations.
Hi Norbert,
there is no problem at all.
Quoted 1 line
What I am missing is the shock protector, there is a sensor built in.
Yes I know, and it seems that a device driver is used under Windows... can you confirm this? Can you see this sensor under the device listing of Windows? Handle 0x0113 might allow to turn on/off this sensor, but then it should controlled by another driver, I'm afraid.
Quoted 5 lines
Quoted 3 lines
This last one is interesting because, from the other DSTDs I have seen, I suspect your notebook to have handle
0x0113, an handle that allows to enable/disable an unknown feature, is it the HDD protection?How can I check that?
I can provide you a patch for testing this feature.
Quoted 10 lines
Quoted 7 lines
This is interesting too. Ok, let's not speak about the multiplexer methods, let us speak about handle
0x0128, related to the Hybrid GFX feature. I have never done a deep analysis, maybe you can help here. First of all, newer VPCZ1 models come with a few more methods, dealing with the screen brightness level, HSC5, HSC6, HSC7. Then:
- HSC0 returns the event reason (1 switch position change? what about 2,3,4?)Currently we are not evaluating HSC0 at all, I am not sure about its function.
HSC0 returns HGER (Hybrid GFX Event Reason), a number that can be read when an Hybrid GFX event is notified (for example when the physical switch change its position), telling userspace what triggered that event.
Quoted 1 line
only HSC1 is used to query the speed/stamina switch.
It also provides other informations, do you know their meaning?
Method (HSC1, 0, Serialized)
{
Store (Zero, Local0)
If (AVIL) <-- ??
{ ... }
If (^^H8EC.SWPS) <-- switch position
{ ... }
If (LEqual (HGAP, One)) <-- Hyb GFX A? Presence?
{ ... }
If (LEqual (HGAP, 0x02)) <-- Hyb GFX A? Presence?
{ ... }
If (HDME) <-- HDMI Exit? HDMI routing capability?
{ ... }
If (DVIE)
{ ... }
If (^^H8EC.ATSW) <-- switch set to auto
{ ... }
...
}Quoted 4 lines
Furthermore, the path of HSC1 is different on different modules
_SB.PCI0.LPC.SNC.HSC1 (VGN) and _SB.PCI0.LPCB.SNC.HSC1 (VPC)
This is not relevant, we just call the SN07 method from the SNC device, so don't care about it.
Quoted 6 lines
Not much more is used actually, but turning on/off the nvidia (secondary gpu) and the speed/stamina led by hooking into
_SB.PCI0.OVGA._DSM (VGN) and _SB.PCI0.P0P2.DGPU._DSM (VPC)with various function indices (2 -> led, 3 -> gpu off).
If I'm not wrong the video driver should take care of calling _DSM and other multiplexing methods (MXDS, MXMX and so on), is it right? We need to find out more about methods HSC1, HSC2, HSC3, HSC4, but I don't own the hardware.
Then we can start changing the code to be more compliant to the kernel guidelines.
Hi Marco,
Quoted 4 lines · Marco Chiappero
Quoted 1 line
What I am missing is the shock protector, there is a sensor built in.
Yes I know, and it seems that a device driver is used under Windows... can you confirm this? Can you see this sensor under the device listing
It was used in the original installation, I often got "turned off HDD due to ....", but I had to reinstall and used a new W7, and I am very lazy in hunting down drivers for W7 since I hardly use it. I will check what I see in the device manager of W7.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
This last one is interesting because, from the other DSTDs I have seen, I suspect your notebook to have handle
0x0113, an handle that allows to enable/disable an unknown feature, is it the HDD protection?How can I check that?
I can provide you a patch for testing this feature.
Yeah, please do so.
Quoted 6 lines
Quoted 2 lines
Currently we are not evaluating HSC0 at all, I am not sure about its function.
HSC0 returns HGER (Hybrid GFX Event Reason), a number that can be read when an Hybrid GFX event is notified (for example when the physical switch change its position), telling userspace what triggered that event.
So HSC0 returns similar data to HSC1.
Quoted 1 line
It also provides other informations, do you know their meaning?
No idea!
Quoted 18 lines
Method (HSC1, 0, Serialized)
{ Store (Zero, Local0) If (AVIL) <-- ?? { ... } If (^^H8EC.SWPS) <-- switch position { ... } If (LEqual (HGAP, One)) <-- Hyb GFX A? Presence? { ... } If (LEqual (HGAP, 0x02)) <-- Hyb GFX A? Presence? { ... } If (HDME) <-- HDMI Exit? HDMI routing capability? { ... }
That would be nice!!!! I am indeed searching for a way to activate HDMI output on my laptop, but didn't manage till now.
Quoted 5 lines
If (DVIE)
{ ... }
If (^^H8EC.ATSW) <-- switch set to auto
{ ... }Can you provide me with a patch so that I can test these things? I mean I can simply switch the position and read values from /sys files.
Quoted 8 lines
Quoted 5 lines
Furthermore, the path of HSC1 is different on different modules
_SB.PCI0.LPC.SNC.HSC1 (VGN) and _SB.PCI0.LPCB.SNC.HSC1 (VPC)This is not relevant, we just call the SN07 method from the SNC device, so don't care about it.
Hmm, in the patch relative to your to turn on/off the nvidia device we use this paths. If you are interested I can send you the patch I am currently working with, relative to 3.0.0-rc7+your patch .
Quoted 2 lines
If I'm not wrong the video driver should take care of calling
_DSMand other multiplexing methods (MXDS, MXMX and so on), is it right?
No. It seems that the video driver (intel) does *not* turn off the nvidia card. I I load it without special action I get an active nvidia card that eats battery time.
Quoted 2 lines
We need to find out more about methods HSC1, HSC2, HSC3, HSC4, but I don't own the hardware.
I am fine with testing many things ... but my actual knowledge of ACPI internals is minimal, sorry.
Best wishes
Norbert
------------------------------------------------------------------------
Norbert Preining preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
ABILENE (adj.)
Descriptive of the pleasing coolness on the reverse side of the pillow.
--- Douglas Adams, The Meaning of Liff