Mac OS X на оборудовании x86 Технический архив 2008–2024
InfiniteMac OSx86 › Ядро OSx86 10.X и архитектура загрузки › Практические модификации DSDT: активация кнопки …
625,378 reads · 2009-01-19 – 2013-01-21
Справочник Ядро 10.X DSDT Gigabyte G31M / P35

Практические модификации DSDT: активация кнопки питания (PWRB), исправление черного экрана при пробуждении, сон при закрытии крышки и горячие клавиши ASUS

Подборка проверенных патчей таблицы DSDT для включения диалогового окна выключения по нажатию кнопки питания корпуса (PWRB), устранения проблемы темного экрана после выхода из режима сна, активации сна при закрытии крышки ноутбука (Clamshell) и завода функциональных клавиш ASUS.

Основной автор
@pentiumpc Опубликовано 2009-01-19
Раздел архива
Ядро OSx86 10.X и архитектура загрузки
Охват в архиве
625,378 просмотров · 101 отобранных заметок (из 107 исходных сообщений) · 2009-01-19 – 2013-01-21
Участники обсуждения (32)
@uman (21)@kizwan (18)@pentiumpc (8)@Slither2008 (6)@candykane (6)@richarda (5)@THeKiNG (4)@breakky (4)@Thireus (3)@Alexaar (2)@The Edge3000 (2)@Gurruwiwi (2)@EnzoFX (2)@Sweaty (2)@ping99 (2)@Nameci (2)+16 more
Справочник оборудования
Workstation Coolers & Thermal Gear ↗ Gigabyte Motherboards ↗ Laptop RAM & SSD Upgrades ↗
Полный технический перевод на русский язык · Все команды терминала, имена кекстов, узлы ACPI и флаги загрузчика сохранены в оригиналеОткрыть оригинал на английском (Original English) →

На форуме есть множество тем по установке OS X с подменой таблицы DSDT — и раз уж вы используете собственный DSDT, с его помощью можно попутно исправить ряд проблем и активировать полезные аппаратные функции.

Что можно активировать и исправить:
1. Активировать кнопку питания PWRB (вызов стандартного диалогового окна выключения/сна при нажатии кнопки на корпусе).
2. Исправить проблему черного (выключенного) экрана при пробуждении системы из сна.
3. Включить режим сна при закрытии крышки ноутбука (Clamshell sleep) в связке с Clamshell.kext (так как Superhai прекратил поддержку своего старого кекста).
4. Завести функциональные горячие клавиши (Hotkeys) на ноутбуках/нетбуках ASUS.

Экспериментальное исправление:
1. Исправление проблем с питанием портов USB в режиме сна (отлично сработало на моем нетбуке Eee PC 1000H, но не дало эффекта на настольной плате DS3L).

Это основные наработки, которые мне удалось протестировать на прошлых выходных — если у вас есть собственные находки по DSDT, обязательно делитесь ими в этой теме!
Все перечисленные патчи проверены на моих системах; если ваша конфигурация отличается, потребуется адаптировать их под свой код DSDT.
Используйте эти примеры как справочный материал для собственных модификаций.

Полевые заметки и отчёты сообщества

Отобрано 101 технических ответов из 107 исходных сообщений темы

Дополнение автора #1 @pentiumpc 2009-01-19

1. Активация кнопки питания (Power Button)

В секции кнопки питания замените имя объекта _HID на _CID:

Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C")) ---> Name (_CID, EisaId ("PNP0C0C"))
Name (_UID, 0xAA)
Name (_STA, 0x0B)
}

Этот простой трюк я подсмотрел на каком-то сайте (уже не вспомню точный источник, автору респект).
После такой правки нажатие физической кнопки питания начинает вызывать стандартное окно выключения/перезагрузки/сна Mac OS X.

Дополнение автора #2 @pentiumpc 2009-01-19

2. Исправление черного экрана при пробуждении из сна

На нетбуке ASUS Eee PC 1000H при выходе из режима сна подсветка матрицы остается выключенной до тех пор, пока вы вручную не нажмете клавишу регулировки яркости. Раньше эту проблему обходили связкой демона SleepWatcher и утилиты reggie_se для прямой записи в регистры при пробуждении.

Но проблему можно решить гораздо изящнее прямо в DSDT, принудительно восстанавливая уровень яркости в методе пробуждения _WAK:

Method (WAK, 1, NotSerialized) //Пробуждение
{
\_SB.PCI0.SBRG.EC0.EC0W (Arg0)
\_SB.PCI0.NWAK (Arg0)
\_SB.PCI0.SBRG.SWAK (Arg0)
LPWK (Arg0)
Store(\_SB.ATKD.PBLG,local0) //---> Считываем сохраненный уровень яркости из памяти NVS
\_SB.ATKD.PBLS(local0) //---> Применяем считанный уровень яркости
}

Достаточно добавить две последние строчки в конец метода пробуждения.

На вашей модели ноутбука имена методов чтения и установки яркости могут отличаться — поищите в своем DSDT аналогичные вызовы.
По этому же принципу можно автоматически инициализировать и другие устройства после выхода из сна.

Дополнение автора #3 @pentiumpc 2009-01-19

3. Режим сна при закрытии крышки ноутбука (Clamshell sleep)

Большинство ноутбуков на хакинтоше не уходят в сон при закрытии крышки экрана (LID). Я долго искал в Google готовый патч DSDT для решения этой проблемы, но ничего не нашел, поэтому написал собственный обработчик:

Если у кого-то есть более элегантный вариант — обязательно поделитесь!

Device (LID0)
{
Name (_HID, EisaId ("PNP0C0D")) //Датчик крышки экрана
Method (_PRW, 0, NotSerialized)
{
Return (Package (0x02)
{
0x0B,
0x04
})
}
Name (LIDS, One)
Method (_LID, 0, NotSerialized)
{
Store (^^PCI0.SBRG.EC0.SF13, LIDS) //Считываем регистр состояния крышки
XOr (LIDS, One, Local0)
IF (Local0) //Если крышка закрыта
{
Notify (SLPB, 0x80) //Посылаем команду перехода в сон
}
Return (LIDS)
}

Найти устройство датчика крышки (LID / LID0) в DSDT очень легко — достаточно добавить внутрь проверку и отправку уведомления Notify (SLPB, 0x80) кнопке сна.

В большинстве ноутбуков датчик крышки лишь сообщает ОС о своем закрытии, но поскольку Mac OS X на обычном ноутбуке не понимает штатного уведомления от PC-датчика LID, мы перекладываем отправку сигнала сна напрямую на уровень таблицы ACPI.

Дополнение автора #4 @pentiumpc 2009-01-19

4. Активация функциональных клавиш ASUS (ASUS Hotkeys)

Если в дереве IORegistry вашего ноутбука присутствуют устройства «ASUS010» или «ATKD», значит, у вас используется контроллер горячих клавиш ASUS, и комбинации Fn+Fx можно полноценно завести через DSDT.

Для этого нужно выяснить, какие именно коды событий ACPI генерирует каждая комбинация клавиш: я написал небольшой тестовый кекст для перехвата и логирования кодов уведомлений, а затем нашел в области видимости _GPE соответствующие им обработчики прерываний (_Qxx). Сопоставив коды клавиш с методами управления оборудованием, я прописал переключение состояний прямо в методы прерываний ACPI.

Теперь у меня работают включение и отключение подсветки экрана, Wi-Fi, Bluetooth, кардридера, веб-камеры, регулировка яркости и т. д. (сейчас разбираюсь с переключением на внешний монитор и переключением частот шины FSB).

Пример кода для управления веб-камерой:
Method (CAMS, 1, Serialized) //Установка состояния камеры
{
Return (OCMS (Arg0))
}

Method (CAMR, 0, Serialized) //Переключатель (тумблер) камеры : добавлено нами
{
Store (OCMG , Local0)
XOr (Local0, One, Local0)
Return (OCMS (Local0))
}

Method (CAMG, 0, Serialized) //Получение текущего состояния камеры
{
Return (OCMG )
}

А вот сам обработчик прерывания нажатия клавиши, вызывающий наш метод переключения:

Method (_Q2A, 0, NotSerialized) //Нажатие кнопки камеры
{
^^^^ATKD.CAMR //Переключаем питание камеры
ATKN (0x1D) //Уведомляем устройство ATKD
}

Дополнение автора #5 @pentiumpc 2009-01-19

5. Исправление отваливания USB после сна (USB sleep fix)

Device (HPET)
                {
                    Name (_HID, EisaId ("PNP0103"))
                    Name (_CID, EisaId ("PNP0C01"))
                    Name (CRS, ResourceTemplate 
                    {
                        Memory32Fixed (ReadOnly,
                            0xFED00000,         // Базовый адрес
                            0x00000400,         // Длина диапазона
                            _Y03)
                    })
                    OperationRegion (^LPCR, SystemMemory, 0xFED1F404, 0x04)
                    Field (LPCR, AnyAcc, NoLock, Preserve)
                    {
                        HPTS,   2, 
                            ,   5, 
                        HPTE,   1, 
                                Offset (0x04)
                    }

Method (_STA, 0, NotSerialized)
{
Return (0x0F)
}

Принудительный возврат статуса 0x0F в методе _STA устройства HPET решил на моем нетбуке проблему с отваливанием портов USB после выхода из сна и отсутствием горячего подключения (Hot-plug).

На сто процентов ручаться за универсальность не буду, но с этим патчем моя система 10.5.6 работает на полностью «ванильных» системных кекстах (используются только декриптор, AnV SMBIOS, PS2-драйверы и OpenHaltRestart — без каких-либо модифицированных кекстов IOUSBFamily, которые вызывали у меня панику ядра).

UPD: Этот же фикс автоматически применяется утилитой DSDT Patcher при запуске с ключом -newHPET, после чего отпадает и необходимость в кексте Disabler.kext.

Заметка #1 @Slither2008 2009-03-03

Я сейчас внимательно изучаю файл dsdt.aml от своего нетбука ASUS Eee PC 1000H и пытаюсь разобраться в назначении методов внутри области _SB.

Подскажите, правильно ли я расшифровал их функции?

Метод — Назначение:

PBL (S/G) = подсветка матрицы (Backlight Set / Get)
CAM (S/G) = веб-камера (Camera Set / Get)
CRD (S/G) = кардридер (Card Reader Set / Get)
WLD (S/G) = беспроводная сеть Wi-Fi (Wireless LAN Set / Get)
CFV (S/G) = управление частотой шины FSB и напряжением?
BTH (S/G) = модуль Bluetooth (Bluetooth Set / Get)
SDSP = переключение активного дисплея (Switch/Swap Display)
HDPS = ?
PBP (S/G) = ?
M3G (S/G) = встроенный 3G-модем (Mobile 3G)
HWCF = ?
GNVS = получение уровня громкости? (подозреваю, что ошибаюсь и это чтение области памяти NVS)
SNVS = установка уровня громкости? (скорее запись в NVS)

Мне уже удалось привязать включение и выключение веб-камеры и Bluetooth на свободную пользовательскую кнопку (код 0x1D). Пытался аналогичным образом завести тумблер Wi-Fi, но заметил, что логика вызовов там чуть сложнее простого ATKN(значение):

В зависимости от текущего состояния метод передает код 0x11 или 0x10, и у меня пока получается только выключить Wi-Fi по Fn+F2, а обратно он уже не включается.

Также подтверждаю, что ваш тестовый кекст ASUS отлично регистрирует нажатия всех кнопок, кроме клавиши отключения Wi-Fi (пишет что-то про неописанный метод, после чего в консоль сыплются сообщения о невозможности перевести Wi-Fi или Bluetooth в энергосберегающий режим, пока не нажмешь Fn+F2 повторно).

Что думаете по этому поводу?

С уважением,

Стив.

Заметка #2 @Slither2008 2009-03-03

Вот таблица кодов событий ACPI, на которую я ориентируюсь (из драйвера под Linux):

# Серебристые кнопки над клавиатурой
KEY_SILVER1="0000001a" # Выключение экрана
KEY_SILVER2="0000001b" # Смена разрешения
KEY_SILVER3="0000001c" # Пользовательская кнопка 1
KEY_SILVER4="0000001d" # Пользовательская кнопка 2

# Комбинации Fn+Fx
KEY_Fn_F1="00000080" # Переход в сон
KEY_Fn_F2=("00000010" "00000011") # Переключение Wi-Fi
KEY_Fn_F5="0000002*" # Уменьшение яркости
KEY_Fn_F6="0000002*" # Увеличение яркости
KEY_Fn_F7="00000016" # Отключение подсветки экрана
KEY_Fn_F8=("00000030" "00000031" "00000032") # Переключение мониторов (XRandR)
KEY_Fn_F9="00000012" # Диспетчер задач
KEY_Fn_F10="00000013" # Отключение звука (Mute)
KEY_Fn_F11="00000014" # Уменьшение громкости
KEY_Fn_F12="00000015" # Увеличение громкости

# Прочие события ACPI
POWER_AC="00000001"
POWER_BAT="00000000"

Если захотите задействовать пустующие комбинации Fn+F3 и Fn+F4, проще всего отловить их коды через утилиту acpi_listen в Linux.

И я всё еще пытаюсь понять, почему обработчики клавиш громкости (F10–F12) так неочевидно спрятаны в коде DSDT.

Дополнение автора #6 @pentiumpc 2009-03-03 ↳ Re: @Slither2008

Комбинация Fn+F1 не возвращает кода клавиши — отправка уведомления Notify (SLPB, 0x80) напрямую переводит систему в режим сна.
Клавиши Fn+F5 и Fn+F6 возвращают коды от 0x20 до 0x2F (15 ступеней регулировки яркости).
Fn+F8 возвращает код переключения видеовыхода (встроенная матрица LCD, внешний монитор VGA или режим дублирования/расширения).
Подключение блока питания возвращает код 0x50, переход на батарею — 0x51.

Для полноценной обработки большинства этих клавиш в самой ОС требуется вспомогательный кекст-драйвер.

Сейчас меня сильно загрузили на основной работе, поэтому разработку драйвера пришлось временно приостановить, но я выкладываю текущую бета-версию для всех желающих:

ASUS Hotkey Enabler (media fire.com/download.php?4lnemnhjnzt)

Этот пакет активирует функциональные клавиши ASUS, избавляет от необходимости в демоне SleepWatcher, назначает глубокий сон на Fn+F1 и легкий сон на закрытие крышки.
Кроме того, на большинство горячих клавиш можно привязать запуск произвольных пользовательских скриптов прямо через редактирование файла Info.plist внутри кекста.

Перед установкой пакета обязательно сохраните резервную копию вашего рабочего файла «DSDT.aml»!

Дополнение автора #7 @pentiumpc 2009-03-03 ↳ Re: @Slither2008
@Slither2008Метод — Описание: CFV (S/G) = установка/чтение частоты FSB и напряжения; SDSP = переключение дисплеев; HDPS = ?; PBP (S/G) = ?; HWCF = ?; GNVS = чтение громкости (наверняка ошибаюсь, скорее работа с областями памяти NVS?); SNVS = установка громкости?...

CFV = управление только частотой шины FSB (Super Hybrid Engine), к напряжению отношения не имеет.
HDP / PBP = переключение между матрицей LCD, внешним монитором или обоими сразу (переключить регистр можно, но чтобы Mac OS X подхватила монитор, требуется принудительно обновить конфигурацию дисплеев).
HWCF = назначение неизвестно.
GNVS / SNVS = чтение и запись в энергонезависимую память Non-Volatile SRAM (область обмена с BIOS).

Метод BIOS возвращает текущую версию прошивки BIOS,
а метод INIT инициализирует само устройство ATKD (его обязательно нужно вызвать при старте драйвера, чтобы контроллер начал присылать коды нажатых клавиш).

P.S. У меня дома почему-то слетает авторизация на форуме ipis-osx, а с работы зайти некогда — пожалуйста, перезалейте мой пакет туда, если не трудно. Спасибо!

Заметка #3 @Slither2008 2009-03-03

Огромное спасибо за разъяснения и за бета-версию драйвера горячих клавиш!

Сейчас оформлю и опубликую подробную заметку со ссылками на форуме сообщества EeeUser / ipis-osx.

С уважением,

Стив.

Заметка #4 @Slither2008 2009-03-03

Тема по применению ваших патчей DSDT:
ipis-osx.wik idot.com/forum/t-135417/enabling-function-keys-by-modifying-your-dsdt#post-403326

Тема по обсуждению вашего экспериментального кекста:
ipis-osx.wik idot.com/forum/t-135405/experimental-asus-hotkey-enabler-kext-driver#post-403338

Заметка #5 @Slither2008 2009-03-04

Я был бы очень рад приложить свои навыки программирования к доработке вашего кекста.

Не могли бы вы поделиться исходным кодом вашего экспериментального драйвера?

С уважением,

Стив.

Заметка #6 @Slither2008 2009-03-05

Я набросал базовый каркас собственного кекста с рабочим циклом событий (IOWorkLoop).

Драйвер успешно инициализируется, находит в IORegistry узел устройства ATKD и входит в метод start().

Однако у меня возникла загвоздка при регистрации источника прерываний IOInterruptEventSource.

Я объявляю его внутри метода start() следующим образом:

interruptSrc = IOInterruptEventSource::interruptEventSource(
(OSObject*)this,
OSMemberFunctionCast( IOInterruptEventAction,
this,
&com_ipis_driver_AsusFNKeys::interruptOccurred ),
(IOService*)provider,
(int)0);

Как только я пытаюсь подгрузить кекст с этим кодом, система мгновенно уходит в панику ядра (KP).

Если закомментировать создание IOInterruptEventSource, оставив пустой шаблон — кекст загружается и привязывается к ATKD без единой ошибки.

Буду очень признателен, если подскажете, в какую сторону копать для правильного перехвата уведомлений ACPI!

Заметка #7 @Alexaar 2009-04-13

Привет! Как продвигаются дела?
Я хочу внести еще несколько улучшений в таблицу DSDT для Eee PC 1000H, и мне нужен совет.

Первый вопрос касается описания контроллера клавиатуры и тачпада PS/2 (дублирую из ветки на InsanelyMac ↗):

Все мы сейчас используем следующий код в DSDT:

Device (PS2K)
                {
                    Name (_HID, EisaId ("PNP0303"))
                    Name (_CID, 0x0B03D041)
                    Method (_STA, 0, NotSerialized)
                    {
                        ShiftLeft (One, 0x0A, Local0)
                        If (And (IOST, Local0))
                        {
                            Return (0x0F)
                        }

                        Return (Zero)
                    }

                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
                        IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
                        IRQNoFlags () {1}
                    })
                }

                Device (PS2M)
                {
                    Name (_HID, EisaId ("SYN0A04"))
                    Name (_CID, Package (0x03)
                    {
                        0x000A2E4F, 
                        0x02002E4F, 
                        0x130FD041
                    })
                    Method (_STA, 0, NotSerialized)
                    {
                        ShiftLeft (One, 0x0C, Local0)
                        If (And (IOST, Local0))
                        {
                            Return (0x0F)
                        }

                        Return (Zero)
                    }

                    Name (_CRS, ResourceTemplate ()
                    {
                        IRQNoFlags () {12}
                    })
                }

Но с ним в дереве IORegistry возникает дублирование узлов PS/2.

Для справки — вот лог инициализации этих портов при загрузке OpenBSD:

ichpcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x02: PM disabled
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbc0: using irq 1 for kbd slot
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0

pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0

Сами клавиатура и тачпад работают нормально, но хотелось бы избавиться от задвоения устройств в IORegistry. Есть идеи, как это поправить?

И второй вопрос: пробовал ли кто-нибудь реализовать автоматическое пробуждение нетбука при открытии крышки экрана (Wake on Clamshell Open)?

Заметка #8 @Alexaar 2009-04-29

Ответов пока нет, очень жаль.
Тем временем я собрал собственный DSDT на базе патчей из этой темы и нескольких своих доработок — под 10.5.6 система теперь работает и спит просто идеально! Правда, функциональные клавиши Fn у меня пока срабатывают через раз.
Продолжаю искать способ реализовать автоматическое пробуждение при открытии крышки экрана (clamshell wakeup) на 1000H. Ни у кого не появилось мыслей на этот счет?

Заметка #9 @Thireus 2009-05-07

Подскажите, пожалуйста, где именно в DSDT и каким образом можно жестко задать параметры шины для разгона процессора до следующих значений:

FSB = 54
PCIE = 176

Хочу получить частоту процессора 1.9 ГГц на своем Eee PC 1000H — точно так же, как я разгоняю его в Windows XP с помощью утилиты eeectl.

Заметка #10 @candykane 2009-05-13

Нашел на форуме InsanelyMac отличную подборку материалов по починке режима сна через метод _WAK — думаю, она прекрасно дополнит нашу коллекцию патчей DSDT:

Справка по методу _WAK (из спецификации ACPI):
Аргументы:
Arg0 — номер состояния сна, из которого выходит система (1 для S1, 2 для S2, 3 для S3 и т. д.).
Возвращаемое значение (пакет из двух 32-битных слов DWORD):
Элемент 0 — битовое поле статуса пробуждения:
0x00000000 — пробуждение прошло успешно
0x00000001 — сигнал пробуждения получен, но произошел сбой из-за нехватки питания
0x00000002 — сигнал пробуждения получен, но произошел сбой из-за перегрева
Прочие значения зарезервированы.
Элемент 1 (PSS) — при ненулевом значении указывает фактическое состояние S-state, в которое реально вошел блок питания.

Таким образом, по стандарту ACPI метод _WAK принимает один аргумент (номер состояния сна) и обязан возвращать в конце своей работы пакет из двух нулевых значений (Package (0x02) {0x00, 0x00}), сигнализирующий ОС об успешном завершении процедуры пробуждения.

Во многих заводских таблицах DSDT этот оператор Return в конце метода _WAK попросту пропущен (из-за чего компилятор iasl выдает предупреждение «Reserved method must return a value (_WAK)»).

Как исправить метод _WAK:

Найдите в вашем DSDT строку Method (_WAK...) и в самый конец метода перед закрывающей фигурной скобкой добавьте возврат пакета из двух нулей:

КОД:
Method (_WAK, 1, NotSerialized)
{
Store (0xFF, DBG1)
If (LEqual (Arg0, 0x03))
{
Store (0x8F, SCP)
}

If (LEqual (Arg0, 0x04))
{
If (LEqual (OSFL, Zero))
{
If (LEqual (OSFX, 0x03))
{
Store (0x59, SMIP)
}
Else
{
Store (0x58, SMIP)
}
}

If (LEqual (OSFL, One))
{
Store (0x56, SMIP)
}

If (LEqual (OSFL, 0x02))
{
Store (0x57, SMIP)
}

If (LEqual (OSFX, 0x03))
{
Store (0x59, SMIP)
}
}

If (LEqual (Arg0, One)) {}
If (OSFL)
{
Notify (\_SB.PWRB, 0x02)
}
Else
{
If (LEqual (RTCW, Zero))
{
Notify (\_SB.PWRB, 0x02)
}
}

Notify (\_SB.PCI0.USB0, Zero)
Notify (\_SB.PCI0.USB1, Zero)
Notify (\_SB.PCI0.USB2, Zero)
Notify (\_SB.PCI0.USB3, Zero)
Notify (\_SB.PCI0.USB4, Zero)
Notify (\_SB.PCI0.USB5, Zero)
Return(Package(0x02){0x00, 0x00}) <------ Добавить эту строчку перед компиляцией
}

Заметка #11 @candykane 2009-05-13

Активация ползунка яркости подсветки (Backlight control)
Еще одно очень полезное устройство для таблиц DSDT любых ноутбуков (добавляется внутрь области видимости Scope (_SB)):

КОД:
Device (PNLF)
{
Name (_HID, EisaId ("APP0002"))
Name (_CID, "backlight")
Name (_UID, 0x0A)
Name (_STA, 0x0B)
}

Позволяет завести нативный драйвер подсветки экрана AppleBacklight и штатный ползунок яркости в настройках монитора.

Заметка #12 @Thireus 2009-05-13

Хм... неужели никто из знатоков не подскажет по моему вопросу о разгоне FSB через DSDT?

Заметка #13 @candykane 2009-05-13

Полное исправление режима сна и работы портов USB после пробуждения на ноутбуках!

Мне наконец-то удалось полностью победить режим сна на своем ноутбуке ASUS!

Корень проблемы крылся в методах питания USB…
Решение оказалось на удивление простым (по аналогии с методом _WAK):

Если вы посмотрите на секции контроллеров USB в своем DSDT, то внутри каждого из них увидите метод:
Method (_PRW, 0, NotSerialized)
{
Return (GPRW (0xYZ, 0xYZ))
}
Найдите в DSDT сам метод Method (GPRW...) и замените в его конце строчку Return (PRWP) на принудительный возврат двух нулей:
КОД:
Return (Package (0x02)
{
Zero,
Zero
})

Для сохранения работоспособности внутренних устройств UHCI (Bluetooth и сканера отпечатков пальцев) после пробуждения мне также пригодились исправленные кексты IOUSBFamily от Slice (огромное спасибо Slice за сборку чистых версий кекстов без отладочного спама в системный лог!).

UPD: Вчера ночью от усталости совсем забыл упомянуть еще одну важнейшую деталь — устройство кнопки питания Device (PWRB)! В заводском DSDT моего ноутбука оно вообще отсутствовало, тогда как в таблицах настоящих MacBook все методы пробуждения USB ссылаются именно на него.
Поэтому если в вашем DSDT нет устройства PWRB, найдите секцию кнопки сна Device (SLPB) и добавьте прямо над ней блок PWRB:
КОД:
Scope (_SB)
{
Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C"))
}

Device (SLPB)
{
Name (_HID, EisaId ("PNP0C0E"))
Method (_PRW, 0, NotSerialized)
{
Return (Package (0x02)
{
0x0B,
0x04
})
}
}
}
После этого найдите в области Scope (_GPE) методы обработки прерываний USB (Method (_Lxy...)) и добавьте внутрь каждого метода UHCI уведомление Notify (\_SB.PWRB, 0x02), а метод для скоростных контроллеров EHCI (_L0D) приведите к виду от настоящего MacBook:
КОД:
Scope (_GPE)
{
Method (_L03, 0, Serialized)
{
Notify (\_SB.PCI0.UHC1, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L04, 0, Serialized)
{
Notify (\_SB.PCI0.UHC2, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L0C, 0, Serialized)
{
Notify (\_SB.PCI0.UHC3, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L0E, 0, Serialized)
{
Notify (\_SB.PCI0.UHC4, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L05, 0, Serialized)
{
Notify (\_SB.PCI0.UHC5, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L0D, 0, Serialized)
{
If (\_SB.PCI0.EHC1.PMES)
{
Store (0x01, \_SB.PCI0.EHC1.PMES)
Notify (\_SB.PCI0.EHC1, 0x02)
Notify (\_SB.PWRB, 0x02)
}

If (\_SB.PCI0.EHC2.PMES)
{
Store (0x01, \_SB.PCI0.EHC2.PMES)
Notify (\_SB.PCI0.EHC2, 0x02)
Notify (\_SB.PWRB, 0x02)
}
}
Такая правка метода _L0D для контроллеров EHCI полностью решает проблему со сном на шине USB 2.0 без всяких костылей вроде EHCISleepEnabler!
Кстати, если внутри этих методов _Lxy прописано упоминание аудиоконтроллера HDEF (или AZAL) — обязательно удалите строчку Notify (...HDEF, 0x02), иначе компьютер будет мгновенно просыпаться сразу после засыпания!
И еще одна хитрость: если вы хотите будить ноутбук или ПК кликом USB-мыши или нажатием клавиши на USB-клавиатуре, посмотрите в IORegistry, на каком именно контроллере UHCx висит ваша мышь, и в соответствующем методе _Lxy замените PWRB на SLPB!

Пользуйтесь на здоровье!

Заметка #14 @candykane 2009-05-13

Подтверждаю, только что завел кнопку питания корпуса для вызова окна выключения:
КОД:
Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C"))
}

Достаточно было просто поменять _HID на _CID!

Заметка #15 @candykane 2009-05-13

Подробное руководство по инъекции параметров звука через DSDT (без HDAEnabler и ALCinject)
Завод звука не должен требовать лишних костылей: держать в системе отдельный кекст-инжектор только ради передачи трех строчек свойств совершенно бессмысленно, когда мы и так используем модифицированный DSDT или строку device-properties.

Кексты HDAEnabler.kext и ALCinject.kext больше не нужны!

Всё, что требуется для работы модифицированного AppleHDA.kext — это передать в реестр IORegistry три параметра:
layout-id
codec-id
PinConfigurations
Их можно передать либо через шестнадцатеричную строку EFI (device-properties), либо напрямую через метод _DSM в таблице DSDT (второй вариант гораздо чище и полностью соответствует спецификации ACPI).

Массив байтов PinConfigurations легко составить из длинной строки ConfigData, которая лежит внутри вашего рабочего файла /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAController.kext/Contents/Info.plist:

Для этого достаточно взять только последний байт из каждого 4-байтового глагола (verb) в строке ConfigData:
<00a71c1f 00a71d40 00a71e21 00a71f02 00b71c40 00b71d90 00b71ea1 00b71f02 00c71c2e 00c71d30 00c71e81 00c71f01 00d71c10 00d71d40 00d71e11 00d71f01 00e71c20 00e71d90 00e71ea1 00e71f01 00f71c12 00f71d10 00f71e11 00f71f01 01071c11 01071d70 01071e11 01071f01 02171c50 02171d21 02171e45 02171f01>

Другой способ — открыть текстовый дамп кодека из Linux, найти все узлы с пометкой [Jack] (Pin Default), перевернуть порядок байтов каждого 32-битного значения (little-endian) и выстроить их по возрастанию номера узла (Node ID):
КОД:
Codec: SigmaTel STAC9274D
Address: 2
Vendor Id: 0x83847621
Subsystem Id: 0x80860419
Revision Id: 0x100201
Default PCM: rates 0x7e0, bits 0x0e, types 0x1
Default Amp-In caps: ofs=0x00, nsteps=0x0e, stepsize=0x05, mute=0
Default Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x02, mute=1

Node 0x0a [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x0221401f: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Green
превращается в 1f402101
00a71c1f 00a71d40 00a71e21 00a71f02

Node 0x0b [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x02a19040: [Jack] Mic at Ext Front
Conn = 1/8, Color = Pink
превращается в 4090a102
00b71c40 00b71d90 00b71ea1 00b71f02

Node 0x0c [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x0181302e: [Jack] Line In at Ext Rear
Conn = 1/8, Color = Blue
превращается в 2e308101
00c71c2e 00c71d30 00c71e81 00c71f01

Node 0x0d [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x01114010: [Jack] Speaker at Ext Rear
Conn = 1/8, Color = Green
превращается в 10401101
00d71c10 00d71d40 00d71e11 00d71f01

Node 0x0e [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x01a19020: [Jack] Mic at Ext Rear
Conn = 1/8, Color = Pink
превращается в 2090a101
00e71c20 00e71d90 00e71ea1 00e71f01

Node 0x0f [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x01111012: [Jack] Speaker at Ext Rear
Conn = 1/8, Color = Black
превращается в 12101101
00f71c12 00f71d10 00f71e11 00f71f01

Node 0x10 [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x01117011: [Jack] Speaker at Ext Rear
Conn = 1/8, Color = Yellow
превращается в 11701101
01071c11 01071d70 01071e11 01071f01

Node 0x21 [Pin Complex] wcaps 0x400301: Stereo Digital
Pin Default 0x01452150: [Jack] SPDIF Out at Ext Rear
Conn = Optical, Color = Grey
превращается в 50214501
02171c50 02171d21 02171e45 02171f01

Если вы хотите вставить полученную строку PinConfigurations в XML-шаблон для генерации строки EFI через gfxutil, переведите ее из hex в формат Base64 командой:
КОД:
echo "1f4021014090a1022e308101104011012090a101121011011170110150214501" | xxd -r -p | openssl enc -base64
Для моей материнской платы Intel D975XBX2 (BadAxe2 с кодеком STAC9274D) это дало строку:
КОД:
H0AhAUCQoQIuMIEBEEARASCQoQESEBEBEXARAVAhRQE=

Узнать точный путь PCI к аудиоконтроллеру можно командой:
КОД:
gfxutil -f HDEF; # если устройство называется AZAL, подставьте AZAL вместо HDEF

На плате BadAxe2 команда вернула:
КОД:
DevicePath = PciRoot(0x0)/Pci(0x1b,0x0)

Далее остается добавить этот блок в входной XML-файл и сконвертировать его в hex-строку командой (gfxutil -s -v -n -i xml -o hex in.plist out.hex):
КОД
    <key>PciRoot(0x0)/Pci(0x1b,0x0)</key>
    <dict>
        <key>PinConfigurations</key>
        <data>
        H0AhAUCQoQIuMIEBEEARASCQoQESEBEBEXARAVAhRQE=
        </data>
        <key>codec-id</key>
        <string>0x83847683</string>
        <key>layout-id</key>
        <string>0x04000000</string>
    </dict>

Но еще лучше прописать эти же данные напрямую в DSDT — ниже приведены дампы ветки HDEF@1B из IORegistry для плат Intel D975XBX (BadAxe1, кодек STAC9221D A2) и D975XBX2 (BadAxe2, кодек STAC9274D):

BadAxe1:
КОД:
| | +-o HDEF@1B <class IOPCIDevice, registered, matched, active, busy 0, retain 8>
| | | | {
| | | | "IOPCIResourced" = Yes
| | | | "IOInterruptControllers" = ("io-apic-0","IOPCIMessagedInterruptController")
| | | | "IOName" = "pci8086,27d8"
| | | | "subsystem-id" = <17040000>
| | | | "IODeviceMemory" = (({"address"=18446744073225109504,"length"=16384}))
| | | | "class-code" = <00030400>
| | | | "revision-id" = <01000000>
| | | | "assigned-addresses" = <10d8008200000000000020e30000000000400000>
| | | | "built-in" = <00>
| | | | "acpi-device" = "IOACPIPlatformDevice is not serializable"
| | | | "name" = "pci8086,27d8"
| | | | "acpi-path" = "IOACPIPlane:/_SB/PCI0@0/HDEF@1b0000"
| | | | "subsystem-vendor-id" = <86800000>
| | | | "reg" = <00d800000000000000000000000000000000000010d800020000000000000000000000000040
000>
| | | | "compatible" = <"pci8086,417","pci8086,27d8","pciclass,040300">
| | | | "PinConfigurations" = <104021021010010120308101104001012190a1011160010130214501>
| | | | "layout-id" = 2
| | | | "IOPCIExpressLinkCapabilities" = 0
| | | | "IOPowerManagement" = {"ChildrenPowerState"=2,"CurrentPowerState"=2}
| | | | "IOInterruptSpecifiers" = (<1600000007000000>,<0400000000000100>)
| | | | "device-id" = <d8270000>
| | | | "vendor-id" = <86800000>
| | | | "device_type" = <"STAC9221A2">
| | | | "codec-id" = 2206496387
| | | | "IOPCIExpressLinkStatus" = 0
| | | | }

BadAxe2:
КОД:
| | +-o HDEF@1B <class IOPCIDevice, registered, matched, active, busy 0, retain 8>
| | | | {
| | | | "IOPCIResourced" = Yes
| | | | "IOInterruptControllers" = ("io-apic-0","IOPCIMessagedInterruptController")
| | | | "IOName" = "pci8086,27d8"
| | | | "layout-id" = <04000000>
| | | | "subsystem-id" = <19040000>
| | | | "IOPCIExpressLinkCapabilities" = 0
| | | | "IODeviceMemory" = (({"address"=18446744073226158080,"length"=16384}))
| | | | "class-code" = <00030400>
| | | | "IOPowerManagement" = {"ChildrenPowerState"=2,"CurrentPowerState"=2}
| | | | "revision-id" = <01000000>
| | | | "IOInterruptSpecifiers" = (<1600000007000000>,<0200000000000100>)
| | | | "assigned-addresses" = <10d8008200000000000030e30000000000400000>
| | | | "built-in" = <00>
| | | | "acpi-device" = "IOACPIPlatformDevice is not serializable"
| | | | "device-id" = <d8270000>
| | | | "vendor-id" = <86800000>
| | | | "acpi-path" = "IOACPIPlane:/_SB/PCI0@0/HDEF@1b0000"
| | | | "subsystem-vendor-id" = <86800000>
| | | | "name" = "pci8086,27d8"
| | | | "IOPCIExpressLinkStatus" = 0
| | | | "reg" = <00d800000000000000000000000000000000000010d800020000000000000000000000000040
000>
| | | | "compatible" = <"pci8086,419","pci8086,27d8","pciclass,040300">
| | | | "PinConfigurations" = <1f4021014090a1022e308101104011012090a101121011011170110150214501>
| | | | "codec-id" = 2206496289
| | | | }

Заметка #16 @candykane 2009-05-13

А вот и сам код для вставки в DSDT (привожу оба примера — для плат BadAxe1 и BadAxe2):
ЗВУК В DSDT:
КОД:
______________________________________________________________

// Вставьте метод DTGP в начало вашего DSDT (сразу после Method (_WAK, 1, Serialized))
Method (DTGP, 5, NotSerialized)
{
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,
/* 0008 */ 0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
}))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}

If (LEqual (Arg2, One))
{
Return (One)
}
}
}

Store (Buffer (One)
{
0x00
}, Arg4)
Return (Zero)
}

______________________________________________________________

// Замените все вхождения имени AZAL на HDEF

______________________________________________________________

// Пример 1: для платы Intel BadAxe1 (с комментариями)

______________________________________________________________

// Добавляется в конец секции Device (HDEF)
// BadAxe1 (D975XBXLKR)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x08)
{
"codec-id",
Buffer (0x04)
{
0x83, 0x76, 0x84, 0x83 // шестнадцатеричный Codec ID в обратном порядке байтов
},
"layout-id",
Buffer (0x04)
{
0x02, 0x00, 0x00, 0x00 // шестнадцатеричный Layout ID в обратном порядке байтов
},
"device_type",
Buffer (0x16) // длина строки + 1 нулевой байт на конце
{
"SigmaTel STAC9221D A2" // строковое название чипа
},
"PinConfigurations",
Buffer (0x1C) // фактическое число байтов массива
{
/* массив байтов PinConfigurations:
/* 0000 */ 0x10, 0x40, 0x21, 0x02, 0x10, 0x10, 0x01, 0x01,
/* 0008 */ 0x20, 0x30, 0x81, 0x01, 0x10, 0x40, 0x01, 0x01,
/* 0010 */ 0x21, 0x90, 0xa1, 0x01, 0x11, 0x60, 0x01, 0x01,
/* 0018 */ 0x30, 0x21, 0x45, 0x01
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}

______________________________________________________________

// Пример 2: для платы Intel BadAxe2

______________________________________________________________

// Добавляется в конец секции Device (HDEF)
// BadAxe2 (D975XBX2KR)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x08)
{
"codec-id",
Buffer (0x04)
{
0x21, 0x76, 0x84, 0x83 // шестнадцатеричный Codec ID в обратном порядке байтов
},
"layout-id",
Buffer (0x02)
{
0x04, 0x00, 0x00, 0x00 // шестнадцатеричный Layout ID в обратном порядке байтов
},
"device_type",
Buffer (0x13)
{
"SigmaTel STAC9274D"
},
"PinConfigurations",
Buffer (0x20)
{
/* 0000 */ 0x1f, 0x40, 0x21, 0x02, 0x40, 0x90, 0xa1, 0x02,
/* 0008 */ 0x2e, 0x30, 0x81, 0x01, 0x10, 0x40, 0x11, 0x01,
/* 0010 */ 0x20, 0x90, 0xa1, 0x01, 0x12, 0x10, 0x11, 0x01,
/* 0018 */ 0x11, 0x70, 0x11, 0x01, 0x50, 0x21, 0x45, 0x01
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}

______________________________________________________________

Заметка #17 @kizwan 2009-06-01 ↳ Re: @pentiumpc

Активация функциональных клавиш на ноутбуках Acer

@pentiumpcКомбинация Fn+F1 не возвращает кода клавиши — отправка уведомления Notify (SLPB, 0x80) напрямую переводит систему в режим сна. Клавиши Fn+F5 и Fn+F6 возвращают коды от 0x20 до 0x2F (15 ступеней регулировки яркости)... Для полноценной обработки большинства этих клавиш в самой ОС требуется вспомогательный кекст-драйвер…

Привет, pentiumpc!

Мне очень нужен твой совет. Я хочу завести в OS X пару специальных кнопок на ноутбуке Acer: в Windows за их работу отвечает утилита «Launch Manager», а в Linux — модуль ядра «acer-acpi». Эти кнопки управляют подачей питания на два важнейших модуля: карточку Wi-Fi и адаптер Bluetooth. К счастью, модуль Wi-Fi автоматически включается при старте ноутбука, а вот модуль Bluetooth по умолчанию обесточен, из-за чего в OS X он вообще не виден на шине USB. Очень надеюсь, что ты подскажешь, как портировать логику «acer-acpi» под OS X — опыта написания собственных кекстов у меня пока нет, но я быстро учусь!

kizwan

Заметка #18 @uman 2009-06-02 ↳ Re: @kizwan

Модуль acer-acpi

@kizwanОчень надеюсь, что ты подскажешь, как портировать логику «acer-acpi» под OS X — опыта написания собственных кекстов у меня пока нет, но я быстро учусь! kizwan

Привет, kizwan! Приятно встретить тебя и на этом форуме, а не только на InsanelyMac (мой старый аккаунт там случайно снесли при переезде форума на новый движок)...

По поводу acer_acpi: у моего сына точно такой же ноутбук Acer, но сейчас на нем умирает жесткий диск, поэтому протестировать лично не могу. Лучшая отправная точка для тебя — это кекст AMW0.kext от Superhai! Правда, недавно Superhai убрал архив с исходниками со своей основной страницы загрузок, так что напиши ему в личку или поищи зеркало.

-u

Заметка #19 @uman 2009-06-02

Управление питанием Bluetooth через DSDT на Acer

Вполне возможно, что включить питание модуля получится и чисто средствами DSDT! На своем ноутбуке Gateway я заметил в DSDT целый ряд управляющих регистров, к которым обращаются горячие клавиши для подачи питания на беспроводные модули.

Внимательно изучи методы пробуждения и Notify в своем DSDT: поскольку при уходе в сон питание Bluetooth отключается, при выходе из сна таблица ACPI должна проверять флаг состояния и подавать питание обратно — по этим обращениям к регистрам в методе _WAK проще всего вычислить нужный бит включения Bluetooth.

Заметка #20 @uman 2009-06-02

kizwan:

Поищи в своем DSDT устройство с именем AMW0 (очень рекомендую прочитать вот эту заметку Карлоса, автора драйвера acer_acpi под Linux: strang eworlds.co.uk/2007/11/24/amw0-later-models-aka-version-2-notes/).

Подозреваю (хотя и не видел твоего DSDT), что инициализация кнопок управления радиомодулями внутри DSDT может быть обернута в условие проверки версии ОС (_OSI == Windows). В моем DSDT таких проверок полно.

Если это так, то можно разблокировать ветку кода для Windows прямо в DSDT, а затем обращаться к методам устройства AMW0 из простенького кекста — скорее всего, именно по такому принципу и работал кекст от Superhai.

Заметка #21 @kizwan 2009-06-03

Извините за задержку с ответом — мне почему-то не пришло уведомление о новых сообщениях в теме.

Вы оказались абсолютно правы! Вот что я нашел в своем файле dsdt.dsl:

        Device (AMW0)
        {
            Name (_HID, "pnp0c14")
            Name (_UID, Zero)
            Name (WLMP, Zero)
            Name (WMID, Zero)
            Name (B0ED, Buffer (0x04)
            {
                0x00, 0x00, 0x00, 0x00
            })
            CreateDWordField (B0ED, Zero, WLID)
            Name (B1ED, Buffer (0x04)
            {
                0x00, 0x00, 0x00, 0x00
            })
            Name (B2ED, Buffer (0x04)
            {
                0x00, 0x00, 0x00, 0x00
            })
            CreateDWordField (B2ED, Zero, BUID)
            Name (_WDG, Buffer (0x0118)

А также вот такой блок инициализации ОС:

    Scope (_SB)
    {
        Method (_INI, 0, NotSerialized)
        {
            Store (0x07D0, OSYS)
            If (CondRefOf (_OSI, Local0))
            {
                If (_OSI ("Linux"))
                {
                    Store (One, LINX)
                }

                If (_OSI ("Windows 2001"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP1"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP2"))
                {
                    Store (0x07D2, OSYS)
                }

                If (_OSI ("Windows 2006"))
                {
                    Store (0x07D6, OSYS)
                }
            }

Я уже несколько дней пытаюсь включить Bluetooth чисто через правки DSDT, но пока безуспешно. Попробую связаться с Superhai по поводу исходников AMW0.kext. Ведь даже в Windows (XP и Vista) кнопки включения Bluetooth и Wi-Fi на этом ноутбуке совершенно мертвы до тех пор, пока не установишь фирменную утилиту «Launch Manager».

Продолжу копать свой DSDT и попробую адаптировать его.

Большое спасибо за наводку!

kizwan

Заметка #22 @uman 2009-06-03

Сам блок _INI трогать не обязательно — он лишь записывает код текущей ОС в переменную OSYS, которую затем проверяют другие методы.

Главное — проследить, чтобы само устройство Device (AMW0) не отключалось при неравенстве OSYS коду Windows, и успешно регистрировалось в дереве IORegistry. А дальше с помощью кекста от Superhai можно либо (а) жестко прописать подачу питания на Bluetooth прямо при старте кекста, либо (б) написать небольшую пользовательскую утилиту (аналог Launch Manager для OS X), передающую команды кексту через интерфейс IOKitLib (см. документацию Apple: gemma.apple.com/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_IOKitLib_API/AH_IOKitLib_API.html#//apple_ref/doc/uid/TP30000380-BAJDAJDJ).

Поскольку оба интерфейса — и «ATKD» на ноутбуках ASUS, и «AMW0» на ноутбуках Acer — построены поверх спецификации Microsoft WMI-ACPI (PNP0C14), принцип работы у них очень схож, и исходники драйвера acer_acpi от Карлоса под Linux послужат тебе лучшим справочником. Удачи!

Заметка #23 @THeKiNG 2009-06-03

Я (не)счастливый обладатель ноутбука ASUS M50Sv.
И у меня схожая эпопея с горячими клавишами Fn...
«Из коробки» у меня работают: переключение Wi-Fi/BT (Fn+F2), переход в сон (Fn+F1), регулировка яркости (Fn+F5 и Fn+F6, если предварительно отключить датчик освещенности в Windows) и отключение подсветки экрана (Fn+F7). При нажатии кнопки переключения мониторов (Fn+F8) ноутбук уходит в мгновенную перезагрузку, а все остальные мультимедийные кнопки и комбинации Fn не работают вовсе.
Пробовал ставить пакет от pentiumpc — никакого эффекта, что, впрочем, неудивительно, так как в моем DSDT внутри устройства ATKD прописан идентификатор ATK0100, а не ASUS010 (я пробовал менять ID и в Info.plist кекста, но тоже безуспешно).

Зато я наткнулся на замечательную программу под Windows — ASUS Notebook Keys (forum.noteboo kreview.com/showthread.php?t=150016), которая позволяет переназначать любые мультимедийные и Fn-клавиши, причем автор выложил ее полные исходные коды (rapid share.com/files/74365305/AsusNbKeys_v1.3_SRC.zip)! С ее помощью я отловил точные шестнадцатеричные коды событий ACPI для всех неработающих кнопок на своем ноутбуке:
(Кстати, сенсорные мультимедийные кнопки на самом тачпаде через ACPI вообще не ловятся — ими заправляет напрямую драйвер тачпада Synaptics).

Вот полный список перехваченных кодов событий ACPI:

Мультимедийные клавиши на стрелках (не работают):
Fn + стрелки:
->: Событие 0x41 — Перемотка вперед
<-: Событие 0x40 — Перемотка назад
^ : Событие 0x43 — Стоп
v : Событие 0x45 — Воспроизведение / Пауза

Функциональный ряд (Fn + F1–F12):
F1: работает — перехватить код нельзя, так как ноутбук сразу засыпает
F2: Событие 0x5D — работает (переключение Wi-Fi / Bluetooth)
F3: Событие 0x50 — запуск почтового клиента
F4: Событие 0x51 — запуск браузера
F5: Событие 0x2D — работает (уменьшение яркости)
F6: Событие 0x1E — работает (увеличение яркости)
F7: Событие 0x34 — работает (вкл/выкл подсветки экрана)
F8: Событие 0x61 — переключение LCD/VGA (вызывает мгновенную перезагрузку!)
F9: Событие 0x68 — отключение тачпада
F10: Событие 0x32 — отключение звука (Mute)
F11: Событие 0x31 — уменьшение громкости
F12: Событие 0x30 — увеличение громкости

Дополнительные буквенные комбинации с Fn:
Fn + T: Событие 0x99 — модем вкл/выкл
Fn + A: Событие 0x7A — датчик внешней освещенности
Fn + C: Событие 0x8A — переключение цветовых профилей Splendid
Fn + V: Событие 0x82 — запуск веб-камеры / захват экрана
Fn + Пробел: Событие 0x5C — переключение режимов энергосбережения Power4Gear

Дополнительные кнопки над клавиатурой:
Кнопка 1: Событие 0x5C — аналогично Fn+Пробел (Power4Gear)
Кнопка 2: Событие 0x6B — неизвестно
Кнопка 3: Событие 0x5C — неизвестно
Кнопка 4: Событие 0x95 — неизвестно
Есть ли у кого-нибудь идеи, как привязать эти коды в DSDT или кексте, чтобы оживить управление звуком и мультимедиа?

Заметка #24 @uman 2009-06-03

Я посмотрю исходники демона acpid.

Поскольку у меня нет ноутбука ASUS, могу поделиться лишь общими архитектурными соображениями:

1. Всегда заглядывайте в исходники ядра Linux — в плане поддержки ноутбучной ACPI-периферии Linux-сообщество ушло далеко вперед по сравнению со сценой OSx86.
2. Вы совершенно правы: вместо того чтобы лепить узкоспециализированные костыли под одну конкретную модель (как сделали владельцы Dell Mini, жестко зашив свои хаки прямо в код ApplePS2Keyboard.cpp и сделав его непригодным для всех остальных), нам нужен универсальный модульный кекст-мост ACPI/WMI.
3. Если мы соберем небольшую группу энтузиастов с ноутбуками разных марок (ASUS, Acer, HP, Dell), то сможем написать единый базовый драйвер WMI/ACPI со сменными таблицами кодов и легкой пользовательской утилитой настройки в панели меню.

Заметка #25 @THeKiNG 2009-06-04 ↳ Re: @uman
@umanЯ посмотрю исходники демона acpid. Поскольку у меня нет ноутбука ASUS, могу поделиться лишь общими архитектурными соображениями: 1. Всегда заглядывайте в исходники ядра Linux... 2. Вы совершенно правы: вместо того чтобы лепить узкоспециализированные костыли под одну конкретную модель, нам нужен универсальный модульный кекст-мост…

Ого, какой быстрый ответ!
Кстати, я тут вспомнил: Superhai как-то говорил мне, что прямой порт линуксового демона acpid в OS X работать не будет из-за различий в архитектуре ядра, так что на него можно не тратить время...
А что касается драйверов клавиатуры PS/2 — вы пробовали VoodooPS2? Я пользуюсь им уже очень давно, работает стабильно и без серьезных багов.
Согласен, кекст AMW0 от Superhai — отличная основа для создания универсального драйвера с плагинами под конкретных производителей.
Сам я, увы, не программист и не знаю C++, просто люблю раскапывать устройство системы с помощью логики и вдумчивого поиска!

Заметка #26 @kizwan 2009-06-05 ↳ Re: @uman
@umanСам блок _INI трогать не обязательно — он лишь записывает код текущей ОС в переменную OSYS, которую затем проверяют другие методы. Главное — проследить, чтобы само устройство Device (AMW0) не отключалось при неравенстве OSYS коду Windows, и успешно регистрировалось в дереве IORegistry…

Спасибо, буду изучать документацию Apple по IOKit — потребуется время, чтобы во всём разобраться.

Тем временем я попробовал подправить исходный код AMW0.kext в соответствии с именами методов из моего файла dsdt.dsl. После этого в дереве IORegistry действительно появилась ветка AMW0, однако кнопки включения модулей пока не ожили.

Над кодом AMW0.kext еще предстоит основательно потрудиться — возможно, почерпну полезные идеи из исходников проекта ACPI4ASUS.kext.

Кстати, не подскажете, как проще всего вычислить в dsdt.dsl конкретный метод, отвечающий за подачу питания на радиомодули? Я наткнулся на следующий метод — правильно ли я понимаю, что именно он дает команду на включение беспроводного модуля при старте (POST)?

    Method (LAMN, 1, NotSerialized)
    {
        If (\_SB.AMW0.WLMP)
        {
            Store (Arg0, \_SB.AMW0.WLID)
            Notify (\_SB.AMW0, 0xB0)
        }
        Else
        {
            PHSR (0x1F, Arg0)
        }
    }

kizwan

Заметка #27 @uman 2009-06-08

К сожалению, я и сам только осваиваю тонкости языка ASL и таблиц DSDT, а производители ноутбуков никогда не публикуют документацию по внутренним методам своих прошивок — так что тут всё познается методом проб и ошибок.

Скинь мне, пожалуйста, ссылку на исходники AMW0.kext — как только закончу возиться со своим драйвером для SD-кардридера (и починю жесткий диск на ноутбуке сына), обязательно поковыряю этот кекст!

Заметка #28 @kizwan 2009-06-09 ↳ Re: @uman
@umanДа, именно исходный код кекста AMW0. Спасибо!

Скачать сам AMW0.kext и его исходный код можно со страницы автора:
supe rhai.com/xdarwin.html

О, так вы пишете драйвер для встроенного кардридера SD! Очень интересно! А есть ли шанс, что ваш драйвер будет поддерживать контроллеры кардридеров от Texas Instruments (TI)?

И, кстати, у вас всё еще наблюдаются графические артефакты на встроенном видео GMA 950? Вы пробовали заводить его через Natit.kext или строку EFI?

kizwan

Заметка #29 @uman 2009-06-09 ↳ Re: @kizwan
@kizwanСкачать сам AMW0.kext и его исходный код можно со страницы автора: supe rhai.com/xdarwin.html

[Хлопает себя по лбу] Как же я сам не заметил эту ссылку у него на сайте! Спасибо! Если на следующей неделе ноутбук сына вернется в строй, обязательно поэкспериментирую с AMW0.

@kizwanО, так вы пишете драйвер для встроенного кардридера SD! Очень интересно! А есть ли шанс, что ваш драйвер будет поддерживать контроллеры кардридеров от Texas Instruments (TI)?

Да, я пишу его как раз под чип Texas Instruments (TI PCIxx12) — именно такой кардридер стоит и в моем Gateway, и в Acer сына! Выбрал эту задачу в качестве тренировочного проекта, чтобы набить руку в программировании ядерных драйверов IOKit.

@kizwanИ, кстати, у вас всё еще наблюдаются графические артефакты на встроенном видео GMA 950? Вы пробовали заводить его через Natit.kext или строку EFI?

Я поставил пару кекстов из дистрибутива iPC — артефакты совсем мелкие, поэтому руки пока не доходили ими заняться. Возможно, позже попробую прописать GMA 950 прямо в DSDT, хотя возня с DSDT, как ты уже сам убедился, отнимает уйму времени!

-u

Заметка #30 @uman 2009-06-09 ↳ Re: @kizwan
@kizwanО, так вы пишете драйвер для встроенного кардридера SD! Очень интересно! А есть ли шанс, что ваш драйвер будет поддерживать контроллеры кардридеров от Texas Instruments (TI)?

После вчерашней новости о том, что Apple встроила штатный слот для карт памяти SD в новые модели MacBook Pro, я решил временно притормозить разработку собственного драйвера — сначала очень хочется взглянуть, как именно Apple реализовала стек SD-кардридера в новых системных кекстах!

Показать ещё 64 заметок сообществаПолная архивная запись
Заметка #31 @THeKiNG 2009-06-10 ↳ Re: @uman
@umanI've put this on hold with yesterday's news that Apple is including SD card slots on the new macbooks. I'd like to see what they have done before proceeding.

For sure they use USB SD Reader i bet on that...
Wonder where did PentiumPC go...
Maybe he can release the source for ACPI4Asus.kext to help us understand what he did and maybe someone can continue his work, if he has no time for that, for the rest of the custom "OEM" stuff that make our life's so PITA.

Заметка #32 @kizwan 2009-06-10 ↳ Re: @uman
@umanI'm using the two? kexts that I found in iPC. I didn't really pay much attention to what they do. The artifacts are minor enough that I haven't bothered to track them down. I may try the DSDT approach, since I want to get better at DSDT mods, but it's so time-consuming, as you've no doubt found out! -u

I was using Natit.kext for GMA950 on Acer Aspire 3680. No artifacts…that I can confirm. Right now I'm using EFI string. Don't forget to restore vanilla AppleIntelIntegratedFramebuffer.kext. Don't get excited yet, dual monitor only works with mirror mode.

I still unable to get display working with DSDT yet except for nVidia Go 7300 on Aspire 9420.

kizwan

Заметка #33 @kizwan 2009-06-10 ↳ Re: @uman
@umanI've put this on hold with yesterday's news that Apple is including SD card slots on the new macbooks. I'd like to see what they have done before proceeding.

I only heard new iPhone is coming soon…iPhone 3G S. ^_^

Заметка #34 @uman 2009-06-18

King,

It may be that your DSDT just has functions defined for Windows, especially since Linux guys also had problems.

Have you talked to or contacted the people at OSXCORES? They have patched BIOSes for OSX:

M50SV AS207 (osxcores.sit e50.net/user/image/asus-m50sv-as207.zip)
ASUS

M50V as209 (osxcores.sit e50.net/user/image/m50vas.209.zip)
ASUS

I'm not sure what fixes they have made, but they do custom work too. See:
osxcores.sit e50.net/services.htm

Perhaps they can help.
-u

Заметка #35 @kizwan 2009-06-24

uman,

Just got a reply from Superhai. Its look like Superhai will not continue AMW0 project. Is there anybody interested continuing his project? :'(

Other topic…
Sleep:-
I found out that by deleting entry for EHCI devices in Acer Aspire 9420 DSDT, it was able to sleep. Now the EHCI devices detected as external/expansion card. Funny thing is external hard disk, which connected to EHCI port, is not turn off when putting laptop to sleep. Is this also happen with real MacBook?

I tried to compare DSDT from MacBook3,1 with mine and I found this:-
Acer Aspire 9420:-

        Method (_L03, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB1, 0x02)
        }

MacBook3,1:-

        Method (_L03, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.UHC1, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

I know that "Notify (\_SB.SLPB, 0x80)" will put computer to sleep but I don't know what "Notify (\_SB.PWRB, 0x02)" do. Do you know what "Notify (\_SB.PWRB, 0x02)" means? In my DSDT, PWRB is handle by SLPB (handle both sleep-button & power-button).

I also found "extra" method in EHCI function (MacBook3,1):-

                Method (_DSM, 4, NotSerialized)
                {
                    Store (Package (0x07)
                        {
                            "AAPL,current-available", 
                            0x04B0, 
                            "AAPL,current-extra", 
                            0x02BC, 
                            "AAPL,current-in-sleep", 
                            0x03E8, 
                            Buffer (0x01)
                            {
                                0x00
                            }
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }

I think instead of removing EHCI entry from DSDT, maybe I can use this code to set EHCI device as external device. Maybe this can fix sleep issue too.

Clamshell:-
Does real MacBook automatically resume from sleep when lid is open? Or still need to push keyboard button to resume from sleep, just like windows?

kizwan

Заметка #36 @uman 2009-06-24 ↳ Re: @kizwan
@kizwanuman, Just got a reply from Superhai. Its look like Superhai will not continue AMW0 project. Is there anybody interested continuing his project? :'(

I wish I could say yes, but my son's Acer has qualified for a replacement. So I won't have a machine that has an AMW0 to test. And that is a huge problem for development. As I understand it, Superhai's AMW0 basically allows you to call into the AMW0 device. The Linux project acer-acpi (and it's successor wmi-acpi) does the same, and supplies some utilities so that you can call/respond to the AMW0 methods.

The IOKit doc is pretty good at showing how to make a user-callable module that calls in-kernel routines. So if you know (or have someone who has an Acer and knows C) it shouldn't be hard to hack. My suggestion is to start a mini-group of Acer users, and see if anyone has any dev experience amongst the group.

Other topic… Sleep:- I found out that by deleting entry for EHCI devices in Acer Aspire 9420 DSDT, it was able to sleep. Now the EHCI devices detected as external/expansion card. Funny thing is external hard disk, which connected to EHCI port, is not turn off when putting laptop to sleep. Is this also happen with real MacBook?

I don't think you want to delete the EHCI devices. I think you need to Notify them like on my MacBook Pro DSDT.

I know that "Notify (\_SB.SLPB, 0x80)" will put computer to sleep but I don't know what "Notify (\_SB.PWRB, 0x02)" do. Do you know what "Notify (\_SB.PWRB, 0x02)" means? In my DSDT, PWRB is handle by SLPB (handle both sleep-button & power-button).

The Mac has 3 devices: PWRB (power button), SLPB (sleep button), and LID0 (the lid switch). Most hackbooks don't have all of these. I believe my gateway only had SLPB (although I am not sure-- my DSDT.dsl does have a PWRB, but I may have added it).

The power button has multiple functions. Normally if you hit it, it brings up a menu to sleep, shutdown, restart or cancel. But when the Mac is already sleeping (not thru lid sleep), it will wake from sleep. there is also some programmatic control of it in the System preferences. When a Mac has slept through the lid switch, then opening the lid switch resumes the Mac.

I also found "extra" method in EHCI function (MacBook3,1):- Method (_DSM, 4, NotSerialized) { Store (Package (0x07) { "AAPL,current-available", 0x04B0, "AAPL,current-extra", 0x02BC, "AAPL,current-in-sleep", 0x03E8, Buffer (0x01) { 0x00 } }, Local0) DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0)) Return (Local0) } I think instead of…

Strange my Macbook dsdt does not have this code AT ALL.

Clamshell:- Does real MacBook automatically resume from sleep when lid is open? Or still need to push keyboard button to resume from sleep, just like windows?

Opening the lid resumes from sleep.

I'm sorry I can't be of much use now. I'm hoping next week that I will find the time to backup and do a retail install of 10.5.7. Only then will I try more DSDT hacking, since right now my machine is a mess of hacked kexts!

-u

Заметка #37 @kDawg 2009-07-15

Multiple video card mods

Has anyone done any work trying to integrate multiple video cards? I've been searching for weeks. Trying to find info regarding DSDT in general is tough.

Заметка #38 @aschar1 2009-08-07

Fixing sleep and usb after wake up

I finally fixed sleep on my lappie!

Hi candykane,

did you already update to 10.5.8 and is your sleep fix stillworking?
Apple probably changed something in Powermanagement which is breaking sleep on most installs.
Do you use Openhaltrestart.kext or is sleep working without it?

Thanks Al

Заметка #39 @sk1nhd33t 2009-08-09 ↳ Re: @pentiumpc
@pentiumpcchange _HID to _CID Device (PWRB) { Name (_HID, EisaId ("PNP0C0C")) ---> Name (_CID, EisaId ("PNP0C0C")) Name (_UID, 0xAA) Name (_STA, 0x0B) } This one I got it off some site, cannot remember where. (credit goes to him/her) This will activate your power button to bring up the shutdown menu.

hmm weird, tried doing this on my gigabyte board but the shutdown menu wont show, when i press the power button my hack will just sleep thats it

Заметка #40 @The Edge3000 2009-08-11 ↳ Re: @sk1nhd33t
@sk1nhd33thmm weird, tried doing this on my gigabyte board but the shutdown menu wont show, when i press the power button my hack will just sleep thats it

Uncheck "Allow power button to put the computer to sleep" in energy saver =P.

Заметка #41 @Gurruwiwi 2009-08-17

I dont mean to hijack the thread, but what beeter place for 2 quick DSDT questions for people who actually seem to know what they are talking about !
No one has been able to answer me, well... because no one seems to actually KNOW what they are saying... Please please help!
DSDT is the voodoo of computers for to me loool...
Ok, I've got 2 Acer laptops and 1 Asus laptop. Just for reference. All had OSx, 10.4 to 10.5, many distros, my latest and greatest in my sig.

How on earth do I know if DSDT is doing something or not ?

iAtkos v7 Chameleon 2 RC1 (now RC2) and fassls DSDT script checked. DSDT.aml
is in root, but I tried in Extra folder and felt absolutely no difference.
On first boot I press power, poweroff window comes up (native install) My multimedia controller on my keyboard controls volume and front row funtions! (photos in link in signature) - Video card not detected (but with strings + 2 kext native HD res QE etc)
Out of the box, FN and up down increases/decreases screen brightness. Other fn work, very few dont.
. Audio works OTB, clicks pops etc, no internal or external mic. VoodooHDA is the same,
Ehternet with kext only... didnt try stringing it because I got it to work
So how do I know if DSDT is working? if I remove it I am almost certain my laptop will respond the same.

My previous laptops, NONE used DSDT, I pressed power button, they worked fine! Brightness and other stuff too... etc etc
and I am scared because I read sometimes
"Patch DSDT at you own risk! !
as in flashing the bios or something... can I bick my laptop with DSDT !?! When can DSDT be dangerous?

I want to try decompiling and fixing my dsdt for Snow... but I dont even know if

1) I actually need it
2) If it is working or not
3) it is dangerous, or when is it dangerous?

ok, three questions

"

Заметка #42 @kizwan 2009-08-17 ↳ Re: @Gurruwiwi
@Gurruwiwi1) I actually need it 2) If it is working or not 3) it is dangerous, or when is it dangerous? …

1) You don't need it unless you need it. If everything is working properly, so you don't need it. DSDT override just for PC that have problem with CPU alias (only can use one core), sound, graphic card, power management & etc.
2) It is working.
3) No hard evidence that it is dangerous. DSDT override can be applied by 2 ways; i) by using dsdt.aml file. ii) by flashing it to ROM permanently. Of course the second one is dangerous if you do it wrongly.

kizwan

Заметка #43 @Gurruwiwi 2009-08-17

thanks for the reply

Ah, ok, you can actually flash a BIOS to mimic hardware change... ouch! no thanks.

The thing is kizwan, if I remove the DSDT.aml file, my system boots (Leo) and behaves the same! Which is really weird since I have perfect use of my multimedia pad (volume, next song, ff, rw, mute, hold and, believe it or not, and, the "enter" button works the same as Enter key, the arrows next to it like cursor, and the envolving white lines "tabs" stuffs depending on program, firefox, openoffice, folders, etc...) and 75% of bios FN keys etc.

For instance, my webcam, out of the box, reads in profile as "Acer Crystal Eye Webcam" - 100% opertional including ichat, ibooth, etc, which is know to crash with some "working" webcams - this withou dsdt or patching or stringing

That is why I say I have no idea, following logic from what I read, how the DSDT WORKS to help boot or not. even if its not present this laptop boots Leo like if it had.

Now I do have dual boot with dsdt present on both sides, but I guarantee you with single boot I had this behaviour

Заметка #44 @EnzoFX 2009-09-03

So the powerbutton fix, will make my power button do either sleep or shutdown/logout/resatart prompt? It depends on the setting in System Prefs is what you guys are saying? (Once enabled through dsdt)

My power button currently does nothing! =P

Заметка #45 @kizwan 2009-09-03 ↳ Re: @EnzoFX
@EnzoFXSo the powerbutton fix, will make my power button do either sleep or shutdown/logout/resatart prompt? It depends on the setting in System Prefs is what you guys are saying? (Once enabled through dsdt) My power button currently does nothing! =P

For a working power button in Mac OS X, a dialog box will appear if you press the power button. In this dialog box, you have a choice either you want to sleep, restart or shutdown (you will see all of the 3 choices).

If your power button does nothing, it means it have not yet enabled in DSDT (most machine has this enabled by default). If you have tried to enabled it in DSDT, maybe the code is wrong. Try to check it again.

kizwan

Заметка #46 @EnzoFX 2009-09-03

I have not tried, but I will.

I was just wondering if what it did (Once working) depended on the setting in Sys Prefs. I.e. whether it just sleeps, or if it gives you the shutdown/etc options.

Заметка #47 @kizwan 2009-09-03 ↳ Re: @EnzoFX
@EnzoFXI have not tried, but I will. I was just wondering if what it did (Once working) depended on the setting in Sys Prefs. I.e. whether it just sleeps, or if it gives you the shutdown/etc options.

Once it working it will always shows you the options, either sleep, shutdown or restart. There is no setting in System Preferences for power button.

kizwan

Заметка #48 @The Edge3000 2009-09-07

I applied the power button fix. However, It only seems to work when I check the box to allow it to sleep the computer. Other than that, it does nothing - no menu or anything.

Заметка #49 @Common_Sense 2009-09-08

I applied the power button fix but it doesn't work, when I press it my computer will enter sleep mode without displaying any message just like it did before I applied the fix, I have a gigabyte EP45-DS3LR, anyone knows whats wrong?, this is how the DSDT looks like:

Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C")) --> Name (_CID, EisaId ("PNP0C0C"))
Method (_STA, 0, NotSerialized)
{
Return (0x0B)
}
}

Заметка #50 @gnychis 2009-09-25

I have a Thinkpad X300, that whenever I put to sleep, I see the wireless light blink, and the the laptop wakes up. It seems as though the wireless card is waking the system after a second or two every time I sleep it.

Does anyone have any recommendations for this in terms of the DSDT? I've attached mine if it helps.

Заметка #51 @msingh 2009-10-05

DSDT advice needed

My system is a Dell D830.

After a lot of tinkering around, I managed to install Snow Leopard on it. Please see my guide ↗.

I did a few DSDT mods to get some basic fixes.

Now, the system sleeps (S3 suspend to ram) but does not deep sleep (S5 suspend to disk), shutdown or reboot. I am using OpenHaltRestart.kext and SleepEnabler.kext. The latter made it possible to even suspend.

I am including my dsdt.dsl (which includes my fixes, by the way).

I see tantalizing references to the sleep button, SBTN, etc., but I have not found any systematic documentation for the code (btw. I am comfortable with coding as I do plenty of numerical coding in my work).

Can anyone take a look and let me know what I need to do to fix my poweroff and hibernate problem ?

The DSDT repository does not contain a fixed DSDT for my laptop.

PS: Microsoft's ASL compiler should be outlawed.

Заметка #52 @2nerd4u 2009-10-20 ↳ Re: @sk1nhd33t
@sk1nhd33tchange _HID to _CID Device (PWRB) { Name (_HID, EisaId ("PNP0C0C")) ---> Name (_CID, EisaId ("PNP0C0C")) Name (_UID, 0xAA) Name (_STA, 0x0B) } This one I got it off some site, cannot remember where. (credit goes to him/her) This will activate your power button to bring up the shutdown menu.

hmm weird, tried doing this on my gigabyte board but the shutdown menu wont show, when i press the power button my hack will just sleep thats it
mine will shut down instantly
edit: well actually it just goes to sleep mode verry fast^^ too bad my system wont wake from sleep...

Заметка #53 @Sweaty 2009-12-21

DSDT shutdown patch

With this and new restart patch chameleon booter from Duvel (strong beer that) I have only fakesmc as an added kext, although I'm about to reinstall voodoohda so I can hopefully have two soundcards working.. anyway this is mm67's work I just found it a pain to find the detail on insane so posting it here.. Thanks to all who put together these fixes. Need to add the two operation region bits and change your method PTS

    OperationRegion (DEBG, SystemIO, 0x80, One)
    Field (DEBG, ByteAcc, NoLock, Preserve)
    {
        DBG1,   8
    }

    OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
    Field (PMRS, ByteAcc, NoLock, Preserve)
    {
            ,   4,
        SLPE,   1,
                Offset (0x08),
        GPSE,   16, 
        GPSS,   16,
                Offset (0x12),
            ,   1, 
        SWGC,   1 
    }

    Method (_PTS, 1, NotSerialized)
    {
        Or (Arg0, 0xF0, Local0)
         Store (Local0, DBG1)
        Store (Zero, \_SB.PCI0.LPCB.AG3E)
        If (LEqual (Arg0, 0x05))
        {
            Store (Zero, SLPE)
            Sleep(0x10)
        }
    }

also your LPCB has to be like so

            Device (LPCB)
            {
                Name (_ADR, 0x001F0000)
                OperationRegion (LPC0, PCI_Config, 0xA4, 0x02)
                Field (LPC0, ByteAcc, NoLock, Preserve)
                {
                    AG3E,   1
                }

I suppose add device ID if you need it, I'm on ICH10 so don't.

Also attaching blackosx's duvel+rekursor version of RC4 here, replace your chameleon boot file with the one from here and add these to boot.plist to get unique UUID and restart fix:

    <key>DeviceID</key>
    <string>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</string>

    <key>RestartFix</key>
    <string>YES</string>
Заметка #54 @mm67 2009-12-21 ↳ Re: @Sweaty
@SweatyWith this and new restart patch chameleon booter from Duvel (strong beer that) I have only fakesmc as an added kext, although I'm about to reinstall voodoohda so I can hopefully have two soundcards working.. anyway this is mm67's work I just found it a pain to find the detail on insane so posting it here.. Thanks to all who put…

It's only this :

    OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
    Field (PMRS, ByteAcc, NoLock, Preserve)
    {
            ,   4,
        SLPE,   1,

and this:

        If (LEqual (Arg0, 0x05))
        {
            Store (Zero, SLPE)
            Sleep(0x10)
        }

that make the shutdown work, rest of the code is Gigabyte specific. This address 0x0430 is also motherboard specific, it is PMBASE+30h. Address of PMBASE is defined in FACP, on most boards it can also be checked from processor definitions. For example I have this in my dsdt:

Processor (CPU0, 0x00, 0x00000410, 0x06)

Here 0x00000410 is referring to PMBASE+10h so I use 0x430 on my Gigabyte board. On my MSI board's dsdt I have this:
Processor (P001, 0x01, 0x00000810, 0x06) {}

So in MSI shutdown code I use this:
OperationRegion (PMRS, SystemIO, 0x0830, 0x13)

Заметка #55 @Sweaty 2009-12-21

Ok cheers mate, had to add the other bits on my board (asus p5ql/epu) to get it to compile, I'll try the simpler way later.. At least it did work the way I bodged it

EDIT: OK fixed code as you suggested I needed to use 0x830, also got rid of unnecessary bits, sometimes I needed to turn PSU off with 0x430 (before I could restart, shutdown was complete), that seems fixed now. Thanks a lot.

Заметка #56 @adityaxavier 2010-01-09

Im in a fix.. Everywhere there is a DSDT Fix for getting the USB port to be displayed as Built-in but i need the opposite..
USB - 3 shows as built-in, but it has bluetooth. hence on sleep i loose bluetooth.. if i remove the entry altogether, i have it as external but my sleep fails..

Am having Lenovo T60p. with ICH7-M chipset.

Thanks,
Xavier

Заметка #57 @ping99 2010-01-18

Shutdown & Restart with sleep fix-Thanks to Sweaty & mm67

Many thanks to Sweaty and mm67. You are really nice. This resolve the problem I thought it would never be resloved.

I just made a small change to Method (_PTS, 1, NotSerialized) in order to resolve sleep issue on my notebook CQ60-202TX. Now let me put all together step by step as a guide. This might help newbie.

1 Add OperationRegion below before Method (_PTS, 1, NotSerialized)
OperationRegion (DEBG, SystemIO, 0x80, One)
Field (DEBG, ByteAcc, NoLock, Preserve)
{
DBG1, 8
}

OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
Field (PMRS, ByteAcc, NoLock, Preserve)
{
, 4,
SLPE, 1,
Offset (0x08),
GPSE, 16,
GPSS, 16,
Offset (0x12),
, 1,
SWGC, 1
}

2 Check Device (LPC) if there is a similar Operation Region "LPC" like below. If you don't have LPC device, just search Name (_ADR, 0x001F0000), sometimes the device name is different.
Device (LPC)
{
Name (_ADR, 0x001F0000)
OperationRegion (LPC0, PCI_Config, 0xA4, 0x02)
Field (LPC0, ByteAcc, NoLock, Preserve)
{
AG3E, 1
}
If there is no OperationRegion LPC, please add code above. In my dsdt's OperationRegion LPC0, there is an EXPE instead of AG3E. So I did not modify it, but had to change a bit in Method (_PTS, 1, NotSerialized) . See mine below:
OperationRegion (LPC0, PCI_Config, 0x40, 0xC0)
Field (LPC0, AnyAcc, NoLock, Preserve)
{
Offset (0x60),
, 10,
EXPE, 1
}

3 Add code below in Method (_PTS, 1, NotSerialized) like this
Method (_PTS, 1, NotSerialized)
{
Or (Arg0, 0xF0, Local0)
Store (Local0, DBG1)
Store (Zero, \_SB.PCI0.LPC.EXPE) //Please change to \_SB.PCI0.LPC.AG3E if you don't have the EXPE, but add AG3E.
If (LEqual (Arg0, 0x05))
{
Store (Zero, SLPE)
Sleep(0x10)
}
Else
{
//**Original Code, this resolved my sleep issue.
}
}

//This is written by mm67. You are really nice.
This address 0x0430 is also motherboard specific, it is PMBASE+30h. Address of PMBASE is defined in FACP, on most boards it can also be checked from processor definitions. For example I have this in my dsdt:

Processor (CPU0, 0x00, 0x00000410, 0x06)

Here 0x00000410 is referring to PMBASE+10h so I use 0x430 on my Gigabyte board. On my MSI board's dsdt I have this:
Processor (P001, 0x01, 0x00000810, 0x06) {}

So in MSI shutdown code I use this:
OperationRegion (PMRS, SystemIO, 0x0830, 0x13)

4 Add these in your com.apple.Boot.plist and then put "boot_RC4_Duvelv2.1_Rekursor" under your boot partition. 
        <key>DeviceID</key>
        <string>******XX-***X-***X-***X-************</string>
        <key>RestartFix</key>
        <string>YES</string>

Now you can remove OpenHaltRestart.kext and PlatformUUID.kext or other similar kexts.

Заметка #58 @Nameci 2010-01-31 ↳ Re: @pentiumpc
@pentiumpcMost portable system don't sleep on closing the LID, I tried to find a DSDT fix for it but cannot find it. (google is my best friend.) so I wrote 1 to fix my own. If you have a better or alternative method, please let me know. Thanks. Device (LID0) { Name (_HID, EisaId ("PNP0C0D")) //LID detection Method (_PRW, 0, NotSerialized) {…

Noob here.

Never did work on my dsdt, I have errors after compiling on which it cannot find the registers. After much of googling, I have edited one value on my dsdt, on the LID0, instead of 0x03 I have made it to 0x04. I have sleep on lid close now, but I still don't have wake on lid open or wake on keyboard press after sleep via Fn+F1.

Here is my DSDT.dsl if somebody care to point me to the right direction.

Заметка #59 @Nameci 2010-01-31

I have repatched the dsdt once again with a fresh one. I delete all dsdt and did the patching once again, i still have sleep on lid close, Fn+F1, on the power button. I can wake thru power button with no problems, I can wake buy plugging or unplugging a usb device. But no wake on lid open or keyboard.

With this dsdt, clamshelldisplay.kext is not necessary anymore, so I have removed this kext.

Btw I have modded my dsdt on LID as almost the same on earlier post by pentiumpc.

Any ideas on how to enabel wake on lid open?

Заметка #60 @uman 2010-03-04

What you need to find is the method that is called upon a lid switch event, which means it is under EC0, the embedded controller device. On a MacBook, it's typically _Q20, which looks like this:

                    Method (_Q20, 0, NotSerialized)
                    {
                        Store (LSTE, LIDS)
                        Notify (\_SB.LID0, 0x80)
                    }

On my Gateway, it's _Q8A:

                    Method (_Q8A, 0, NotSerialized)
                    {
                        If (LIDE)
                        {
                            Store ("_Q8A : LID Switch Event", Debug)
                            Store (0x01, LIDE)
                            If (IGDS)
                            {
                                Store (0x90, SMIF)
                                Store (0x00, TRP0)
                            }

                            Notify (\_SB.LID0, 0x80)
                        }

on many other notebooks, it's _Q09. So you'll need to find where it is, and add the appropriate Notify call, to inform the OS that the laptop should be woken up. (I've modified my DSDT to use LID0, to better match the MacBook DSDT).

Заметка #61 @kizwan 2010-03-11

Enabled bluetooth on Acer Aspire 9420

Do you remember, not a long time a go, I'm pursuing to enable bluetooth in Mac OS X? I'm still unable to get the bluetooth button working but I'm able to make the bluetooth device working via DSDT hacking. I'm still however unable to trigger the bluetooth ON/OFF button. I even trying to re-map the bluetooth ON/OFF button to another button (Fn+..) but unsuccessful. Therefore, I modify System Wake (_WAK) to enable bluetooth. This is for temporary solution. When hot booting the computer, it need to be put to sleep one time only & waking up the computer will turning ON the bluetooth device. To make it working cleanly, I modify both System Wake (_WAK) and Prepare to Sleep (_PTS). In the process, I also fixed the wireless device won't turn ON after waking from sleep.

_WAK code:-

    Method (_WAK, 1, NotSerialized)
    {
        Store (Arg0, P80H)
        If (LEqual (Arg0, 0x03))
        {
            Store (CIRT, \_SB.PCI0.LPCB.EC0.CIRE)
        }

        If (LOr (LEqual (Arg0, 0x03), LEqual (Arg0, 0x04)))
        {
            Store (EEPM, \_SB.PCI0.LPCB.EC0.WEPM)
            Store (CAST, \_SB.PCI0.LPCB.EC0.CAME)
            Store (WLPW, \_SB.PCI0.LPCB.EC0.WLEN)
            Store (BTPW, \_SB.PCI0.LPCB.EC0.BTEN)
            Store (WLLE, \_SB.PCI0.LPCB.EC0.WLLD)
            Store (BTLE, \_SB.PCI0.LPCB.EC0.BTLD)
        }

        Store (0x00, \_SB.PCI0.LPCB.EC0.MUTE)
        Store (0x00, \_SB.PCI0.LPCB.EC0.KTAF)
        Store (0x01, \_SB.PCI0.LPCB.EC0.KTEE)
        // start
        // Add support for Wireless & Bluetooth devices (power & LED).
        // Turned ON Wireless & Bluetooth devices after resume from Sleep.
        Store (0x01, \_SB.PCI0.LPCB.EC0.WLEN)
        Store (0x01, \_SB.PCI0.LPCB.EC0.WLLD)
        Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN)
        Store (0x01, \_SB.PCI0.LPCB.EC0.BTLD)
        // end
..................

_PTS code:-
- Preventing the wireless device from turn OFF before goes to sleep. Therefore, the wireless device can be turn ON after waking from sleep.

    Method (_PTS, 1, NotSerialized)
    {
        Store (Arg0, P80H)
        Store (0x01, \_SB.PCI0.LPCB.EC0.MUTE)
        If (LEqual (Arg0, 0x03))
        {
            Store (\_SB.PCI0.LPCB.EC0.CIRE, CIRT)
        }

        If (LEqual (Arg0, 0x04))
        {
            Store (0x01, \_SB.PCI0.LPCB.EC0.BLNK)
            Store (0x00, \_SB.PCI0.LPCB.EC0.CIRE)
        }

        If (LOr (LEqual (Arg0, 0x03), LEqual (Arg0, 0x04)))
        {
            Store (\_SB.PCI0.LPCB.EC0.WEPM, EEPM)
            Store (\_SB.PCI0.LPCB.EC0.CAME, CAST)
            Store (\_SB.PCI0.LPCB.EC0.WLEN, WLPW)
            Store (\_SB.PCI0.LPCB.EC0.BTEN, BTPW)
            Store (\_SB.PCI0.LPCB.EC0.WLLD, WLLE)
            Store (\_SB.PCI0.LPCB.EC0.BTLD, BTLE)
        }

        Store (0x00, \_SB.PCI0.LPCB.EC0.CAME)
        Store (0x00, \_SB.PCI0.LPCB.EC0.CIRE)
        // Preventing Wireless device from turning OFF when system going to Sleep.
        // Store (0x00, \_SB.PCI0.LPCB.EC0.WLEN)
        // start
        // Add support for Wireless (LED) & Bluetooth (power & LED) devices.
        // Turned OFF Wireless (LED) & Bluetooth (power & LED) devices before going to Sleep.
        Store (0x00, \_SB.PCI0.LPCB.EC0.WLLD)
        Store (0x00, \_SB.PCI0.LPCB.EC0.BTEN)
        Store (0x00, \_SB.PCI0.LPCB.EC0.BTLD)
        // end
        If (LEqual (Arg0, 0x05))
        {
            PHSR (0x28, 0x00)
        }
    }

Applying this fix causing the computer unable to sleep anymore because USB4 device (where the bluetooth device attached to) causing the system wake immediately. I remember that according to ACPI Specification revision 4 documentation; in addition to the _PRW control method, _PSW control method can be used to enable or disable the device’s ability to wake a sleeping system.

Arguments: (1) Arg0 – An Integer containing a wake capability control 0 – Disable the device’s wake capabilities 1 – Enable the device’s wake capabilities

By looking at USB4 device in DSDT, there is _PSW entry that can be manipulate. This is the entry for USB4 device in DSDT after modifying the argument (set to 0):-

            Device (USB4)
            {
                Name (_ADR, 0x001D0003)
                OperationRegion (U4CS, PCI_Config, 0xC4, 0x04)
                Field (U4CS, DWordAcc, NoLock, Preserve)
                {
                    U4EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x0E, 
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        // Store (0x03, U4EN)
                        // Disable USB4 capability to wake a sleeping system
                        Store (0x00, U4EN)
                    }
                    Else
                    {
                        Store (0x00, U4EN)
                    }
                }

                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x02)
                }

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x02)
                }
            }

The last FIX enable the computer to sleep again.

kizwan

Заметка #62 @uman 2010-03-12

Nice work! Too bad I don't have bluetooth!

I've come to the conclusion that getting access to keyboard events is impossible in DSDT. I think you have three choices: construct an AMW0 device kext to bind to the AMW0 (which I presume is in your DSDT). This would be a challenge, but might allow you to be straight retail. Two, hack at ApplePS2Keyboard (if PS2) or something else if USB. Or three, do the same with VoodooPS2 (again if PS2).

If you have USB, your job may be easier, since you might be able to do it outside kernel space.

Заметка #63 @kizwan 2010-03-12

Battery indicator

I'm successfully compiled AMW0.kext for SL but got kernel panic while initializing some MethodTerm at boot. Since AMW0.kext project is not finished, I think I'm going to try ACPI4ASUS.kext instead. If ACPI4ASUS.kext developed to works with AMW0 v2 interface (AMW0 and WMID), it should works with other laptop model too.

I'm trying to enable battery icon by patching DSDT. It is being done by adjusting ADP1 & BAT0 code according to DSDT from MBP4,1. Not successful yet, but the battery indicator did show up. It said battery is not detected & current power source is power adapter. Do you think it is possible to make it working by just patching the DSDT?

EDIT: I have found the right "query method" to automatically turn ON Bluetooth device during boot-up. I just tried all of the "query method" in the DSDT until I found the right one.

                    Method (_Q3F, 0, NotSerialized)
                    {
                        // start
                        // auto turn ON Bluetooth device during computer startup
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN)
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTLD)
                        // end
                        HKEY (0x3F)
                    }

kizwan

Заметка #64 @breakky 2010-03-13

Can you somebody help me to enable my audio on Snow Leopard?My audio chip is Realtek ALC662:
I make a codec dump:You can download and see it.

hot file.com/dl/32500771/8b28fa6/Realtek_ALC662_dump.txt.rar.html

I want to fix my audio in DSDT, so I read your tutorial and convert the Default pinconfig on each "[JACK]" device:

Mic (colour:Pink) 01a19830 ---> reversed 3098a101

Mic which is not a jack 99a3093f ---> 3f09a399

HP - 0121401f ---> 1f402101

SPDIF -01441120 ---> 20114401

This is my audio configuration on my laptop.

I don't know how to generate values which I haveto enter in my DSDT.This is my DSDT (HDEF):

Device (HDEF)
            {
                Name (_ADR, 0x001B0000)
                OperationRegion (HDAR, PCI_Config, 0x4C, 0x10)
                Field (HDAR, WordAcc, NoLock, Preserve)
                {
                    DCKA,   1, 
                            Offset (0x01), 
                    DCKM,   1, 
                        ,   6, 
                    DCKS,   1, 
                            Offset (0x08), 
                        ,   15, 
                    PMES,   1
                }

                Name (_PRW, Package (0x02)
                {
                    0x0D, 
                    0x03
                })
            }
Заметка #65 @breakky 2010-03-13 ↳ Re: @kizwan
@kizwanEDIT: I have found the right "query method" to automatically turn ON Bluetooth device during boot-up. I just tried all of the "query method" in the DSDT until I found the right one. Method (_Q3F, 0, NotSerialized) { // start // auto turn ON Bluetooth device during computer startup Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN) Store (0x01,…

Where you put this code?

I searched in my DSDT for

Method (_Q3F, 0, NotSerialized)

, But didn't find it.I have a laptop with Bluetooth, where to put this code?

Заметка #66 @uman 2010-03-13 ↳ Re: @kizwan
@kizwanI'm successfully compiled AMW0.kext for SL but got kernel panic while initializing some MethodTerm at boot. Since AMW0.kext project is not finished, I think I'm going to try ACPI4ASUS.kext instead. If ACPI4ASUS.kext developed to works with AMW0 v2 interface (AMW0 and WMID), it should works with other laptop model too.

So does Asus use AMW0, or do you need to add that code from AMW0. A WMID kext would be useful as many PC vendors use that interface. uninc's DSDT was hideously intertwined with WMID.

I'm trying to enable battery icon by patching DSDT. It is being done by adjusting ADP1 & BAT0 code according to DSDT from MBP4,1. Not successful yet, but the battery indicator did show up. It said battery is not detected & current power source is power adapter. Do you think it is possible to make it working by just patching the DSDT?

I'm not sure, but given that the ACPI 4.0 spec devotes pages and pages to battery and power issues, I think it is at least possible. I also intend to try to solve this (but it's a lower priority for me because my laptop battery is toast anyway). I tried VoodooBattery, which worked great (it told me my battery was toast, lol), but then it kernel panic'ed HARD and I had to repair my disk, so I won't be using that again.

EDIT: I have found the right "query method" to automatically turn ON Bluetooth device during boot-up. I just tried all of the "query method" in the DSDT until I found the right one. Method (_Q3F, 0, NotSerialized) { // start // auto turn ON Bluetooth device during computer startup Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN) Store (0x01,…

I still don't understand how query methods are executed, nor how they are bound to some device. ACPI says:

"For an embedded controller event, OSPM will queue the control method of the name _QXX, where XX is the hex format of the query code. Notice that each embedded controller device can have query event control methods. Similarly, for an SMBus driver, if no driver registers for SMBus alarms, the SMBus driver will queue control methods to…

And then they discuss it more with a completely unhelpful example. Oh wait, the acpi implementers guide is more helpful:

What’s the trap? Using decimal instead of hexadecimal numbers in _Lxx, _Exx, and _Qxx names in your ASL code. When the number (xx) in the _Lxx, _Exx, or _Qxx event handler object name in the ASL code does not match the number of the bit in the GPE register block (or match the number of the embedded controller query number in the case…

DSDT is fun but time consuming!

Заметка #67 @uman 2010-03-13 ↳ Re: @breakky
@breakkyWhere you put this code? I searched in my DSDT for Method (_Q3F, 0, NotSerialized) , But didn't find it.I have a laptop with Bluetooth, where to put this code?

Each laptop model is going to be different. That's why you have to be prepared to do some work to get DSDT going. You will first need to determine what symbols, events, and queries correspond to your bluetooth device. Then kizwan's code can act as a guide.

Заметка #68 @kizwan 2010-03-13 ↳ Re: @breakky
@breakkyWhere you put this code? I searched in my DSDT for Method (_Q3F, 0, NotSerialized) , But didn't find it.I have a laptop with Bluetooth, where to put this code?

It is hardware & BIOS specific. You may have different query method. I'm afraid, you need to try & error every query method in your DSDT.

EDIT: You may want to follow uman suggestion (next post) to get your audio working. It is much easier.
As for your sound, you need to do a lot of work to get your sound working. You already have HDEF entry in DSDT, so you just missing legacy/patched kext. You need to put your ConfigData & Pin Config in legacy/patched kext. Use this legacy kext as a template:-
media fire.com/?vkzyzmtzozo
If you like to put ConfigData & PinConfigurations in DSDT, this is how HDEF entry will look like (between "// start" & "// end"):-

            Device (HDEF)
            {
                Name (_ADR, 0x001B0000)
                Name (HDWA, 0x00)
                Name (_PRW, Package (0x02)
                {
                    0x05, 
                    0x03
                })
                Method (_PS0, 0, Serialized)
                {
                    If (LEqual (HDWA, 0x00))
                    {
                        Store (0x01, HDWA)
                        HKEY (0x8F)
                    }
                }

                Method (_PS3, 0, Serialized)
                {
                    Store (0x00, HDWA)
                }
                // start - required code
                Method (_DSM, 4, NotSerialized)
                {
                    Store (Package (0x0C)
                    {
                        "built-in",
                        Buffer (One)
                        {
                            0x00
                        },

                        "codec-id",
                        Buffer (0x04)
                        {
                            0x83, 0x08, 0xEC, 0x10
                        },

                        "ConfigData",
                        Buffer (0x40)
                        {
                            /* 0000 */    0x01, 0x47, 0x1C, 0x30, 0x01, 0x47, 0x1D, 0x11,
                            /* 0008 */    0x01, 0x47, 0x1E, 0x0B, 0x01, 0x47, 0x1F, 0x01,
                            /* 0010 */    0x01, 0x87, 0x1C, 0x10, 0x01, 0x87, 0x1D, 0x01,
                            /* 0018 */    0x01, 0x87, 0x1E, 0xA0, 0x01, 0x87, 0x1F, 0x90,
                            /* 0020 */    0x01, 0xA7, 0x1C, 0x20, 0x01, 0xA7, 0x1D, 0x31,
                            /* 0028 */    0x01, 0xA7, 0x1E, 0x81, 0x01, 0xA7, 0x1F, 0x01,
                            /* 0030 */    0x01, 0xE7, 0x1C, 0x40, 0x01, 0xE7, 0x1D, 0xE1,
                            /* 0038 */    0x01, 0xE7, 0x1E, 0x45, 0x01, 0xE7, 0x1F, 0x01
                        },

                        "layout-id",
                        Buffer (0x04)
                        {
                            0x0C, 0x00, 0x00, 0x00
                        },

                        "device-type",
                        Buffer (0x11)
                        {
                            "Mobile ALC883 S/T"
                        },

                        "PinConfigurations",
                        Buffer (0x10)
                        {
                            /* 0000 */    0x30, 0x11, 0x0B, 0x01, 0x10, 0x91, 0xAB, 0x01,
                            /* 0008 */    0x20, 0x31, 0x81, 0x01, 0x40, 0xE1, 0x45, 0x01
                        }
                    }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }
                // end - required code
            }

I'll try to construct ConfigData & PinConfigurations for you but I can't promise.

kizwan

Заметка #69 @uman 2010-03-13

Are you planning to use VoodooHDA, or AppleHDA? If Voodoo, first rename all references to HDEF to ALC6 (or whatever turns you on :)) Doing so will prevent AppleHDA from loading and matching your HDA device. If AppleHDA is loaded, then VoodooHDA doesn't load.

Next, and this is common for both Apple and Voodoo. Add this to your HDEF or ALC6 device:

Method (_DSM, 4, NotSerialized) { Store (Package (0x04) { "layout-id", Buffer (0x04) { 0x0C, 0x00, 0x00, 0x00 }, "PinConfigurations", Buffer (Zero) {} }, Local0) DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0)) Return (Local0) }

You can then add your pin configs in there or in the plist depending on how you want to get sound going. See the great guide on infinitemac, or the one on projectosx.

Search my posts and look for my question on pinconfigs to find the links. I'm still trying to find out how to get my pinconfigs without Windows, since I don't run that anymore!

Заметка #70 @barnum 2010-03-13 ↳ Re: @kizwan
@kizwanBy looking at USB4 device in DSDT, there is _PSW entry that can be manipulate. This is the entry for USB4 device in DSDT after modifying the argument (set to 0):- Device (USB4) { Name (_ADR, 0x001D0003) OperationRegion (U4CS, PCI_Config, 0xC4, 0x04) Field (U4CS, DWordAcc, NoLock, Preserve) { U4EN, 2 } Name (_PRW, Package (0x02) {…

can you tell me what modification should I apply to this code to disable sleep for a device in usb2 ?

regards,
Vincent

Заметка #71 @kizwan 2010-03-13 ↳ Re: @uman
@umanSo does Asus use AMW0, or do you need to add that code from AMW0. A WMID kext would be useful as many PC vendors use that interface. uninc's DSDT was hideously intertwined with WMID.

Looks like I still need to go through WMI and ACPI documentation to have better understanding. Then I can make this successful.

@umanI'm not sure, but given that the ACPI 4.0 spec devotes pages and pages to battery and power issues, I think it is at least possible. I also intend to try to solve this (but it's a lower priority for me because my laptop battery is toast anyway). I tried VoodooBattery, which worked great (it told me my battery was toast, lol), but then…

Yeah, it's a low priority for me too. Just playing around.

I guess to make it working, maybe need to determine which query method it use. I said that because I found that there are query method that called ADP1 & BAT0 device. Just don't know what it do & what it contribute to battery detection.

@umanI still don't understand how query methods are executed, nor how they are bound to some device. ACPI says: And then they discuss it more with a completely unhelpful example. Oh wait, the acpi implementers guide is more helpful:

I'm going to grab the acpi implementers guide.

@umanDSDT is fun but time consuming!

I agree.

Заметка #72 @kizwan 2010-03-13 ↳ Re: @barnum
@barnum… can you tell me what modification should I apply to this code to disable sleep for a device in usb2 ? …

Do you mean you want to disable USB2 capability to wake a sleeping system, don't you? If in "Device (USB2)" entry it have _PSW (Power State Wake) method, you will need to change it according to my modification.

                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        // Store (0x03, U4EN)
                        // Disable USB4 capability to wake a sleeping system
                        Store (0x00, U4EN)
                    }
                    Else
                    {
                        Store (0x00, U4EN)
                    }
                }

Refer to arguments for _PSW:

Arguments: (1) Arg0 – An Integer containing a wake capability control 0 – Disable the device’s wake capabilities 1 – Enable the device’s wake capabilities

That is why I change both condition to execute the same thing. So that it always execute the same "Store" operation as if it is Arg0=0.

kizwan

Заметка #73 @breakky 2010-03-13 ↳ Re: @uman
@umanAre you planning to use VoodooHDA, or AppleHDA? If Voodoo, first rename all references to HDEF to ALC6 (or whatever turns you on :)) Doing so will prevent AppleHDA from loading and matching your HDA device. If AppleHDA is loaded, then VoodooHDA doesn't load. Next, and this is common for both Apple and Voodoo. Add this to your HDEF or…

I planed to use AppleHDA with DSDT.aml fix.This is my original DSDT.aml

hot file.com/dl/32576445/45eb3b8/DSDT.dsl.zip.html

By the way I use AsereBLN booter 1.1.9.

Заметка #74 @kizwan 2010-03-13 ↳ Re: @breakky
@breakkyI planed to use AppleHDA with DSDT.aml fix.This is my original DSDT.aml

Try this legacy kext for ALC662 (Snow Leopard):-
media fire.com/?kmnykkqmy5m

Make sure AppleHDA.kext in /System/Library/Extensions/ folder is original kext. Remember to put _DSM method in Device (HDEF) (please refer to uman's post #81 →).

You also need to put DTGP code in DSDT. Put it afterMethod (_WAK) function.

    Method (DTGP, 5, NotSerialized)
    {
        If (LEqual (Arg0, Buffer (0x10)
                {
                    /* 0000 */    0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44, 
                    /* 0008 */    0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
                }))
        {
            If (LEqual (Arg1, One))
            {
                If (LEqual (Arg2, Zero))
                {
                    Store (Buffer (One)
                        {
                            0x03
                        }, Arg4)
                    Return (One)
                }

                If (LEqual (Arg2, One))
                {
                    Return (One)
                }
            }
        }

        Store (Buffer (One)
            {
                0x00
            }, Arg4)
        Return (Zero)
    }

kizwan

Заметка #75 @breakky 2010-03-14

When I try to compile my dsdt.dsl I get one error:

4644: DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Error    4067 -    ^ Object is not accessible from this scope (DTGP)


Nevermind I found where is the error and fix it!

Заметка #76 @kizwan 2010-03-14 ↳ Re: @breakky
@breakkyWhen I try to compile my dsdt.dsl I get one error: 4644: DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0)) Error 4067 - ^ Object is not accessible from this scope (DTGP) Nevermind I found where is the error and fix it!

How about the sound? Is it working?

Заметка #77 @richarda 2010-03-16

This thread has been very useful for me. I now just miss one last step to have the "perfect" install.
I'm running Snow Leopard on an ASUS eeePC 901 from the SD card. It's a bit slow but this is OK.

My problem: whenever I go to sleep and wake-up from sleep, I guess the SD card (my "boot drive") gets brutally ejected and…well, it's bad.

My question: is there any DSDT mod that would allow my SD card to stay mounted (powered maybe) during all the cycle wake-sleep-wake ?

I found a lot of approaching stuff on the thread but nothing exactly like that. this would make may day.

Any idea anyone ?

Thanks, Richard.

Заметка #78 @uman 2010-03-18 ↳ Re: @richarda
@richardaThis thread has been very useful for me. I now just miss one last step to have the "perfect" install. I'm running Snow Leopard on an ASUS eeePC 901 from the SD card. It's a bit slow but this is OK. My problem: whenever I go to sleep and wake-up from sleep, I guess the SD card (my "boot drive") gets brutally ejected and…well, it's bad.…

Yes, but it depends on the underlying hardware. I've found los of good info about my own laptop in my chipset doc (ICH7), and there is lots of good info on the SATA part of the device control. I assume the SSD is controled through SATA?

Заметка #79 @richarda 2010-03-18

Thanks for the info. Not sure I was clear enough tough. I'm having the problem with the SD card (I believe it's using an internal USB port) and the machine is an eeePC 901.
I need help on this one…please.

Заметка #80 @uman 2010-03-19 ↳ Re: @richarda
@richardaThanks for the info. Not sure I was clear enough tough. I'm having the problem with the SD card (I believe it's using an internal USB port) and the machine is an eeePC 901. I need help on this one…please.

My bad. I'm so used to SD cards not working, that I assumed you meant SSD.

You could try the following:

1. Determine what USB slot your SD card is occupying. Easiest is to highlight he drive in disk utility and right-click Information. You should see something like: IODeviceTree:/PCI0@0/USB7@1D,7. That tells me that it's using USB7.

2. Edit your DSDT to replace the _PRW for the indicated USB slot with:

            Device (USB7)
            {
                ...
            // package (argnum) {GPEbit, Wakelevel, PowerResource}
            Name(_PRW, Package()
                {
                    <xx>, // Bit number in GPEx_EN to enable USB resume 
                    0x01  // Reference to lowest sleeping state which can be 
                       // entered while still providing wake functionality
                       // no relative power resource specified
                })

where I have <xx> above, keep your DSDT's existing value, as that's the handler in the GPE for USB7. What I've highlighted in red is the change. Your existing DSDT likely has 0x03, which is effectively powered off.

What the 0x01 does is says that the drive still needs power. That *might* be enough to keep it from being ejected. But it might also prevent the computer from sleeping.

Take a look at the ACPI spec (4.0 rev) Chapter 7.2 for some of the things you can do with power management.

Заметка #81 @saul1d 2010-03-20

ive been lurking around on this thread for a week or two now, and i'm more interested in getting my laptop fully working. ive been running osx for about a year now and i'm pretty familiar with everything except DSDT.

basically what i'm trying to get working:

- GMA X3100: was working with leo, but with 10.6.2 i lost the ability to make the
screen turn off.(although i still have QE/CI)
- Backlight: has never worked, "invalid firmware max backlight" problem. i was
hoping DSDT would be able to fix this
- Sleep: although i'm not too worried about it, it would be nice.

I have a Gateway M6841. I don't think it's a too popular system to be using for a hackintosh, so there's not much help that i've found in the forums.

here is my patched DSDT. its patched for sleep, backlight, and gmax3100 but it hasnt changed any of the problems. thanks to anyone that can help or at least point me in the right direction, i do have programming experience if it helps.

Заметка #82 @richarda 2010-03-20 ↳ Re: @uman
@umanMy bad. I'm so used to SD cards not working, that I assumed you meant SSD. You could try the following: 1. Determine what USB slot your SD card is occupying. Easiest is to highlight he drive in disk utility and right-click Information. You should see something like: IODeviceTree:/PCI0@0/USB7@1D,7. That tells me that it's using USB7.…

Hello,
Thanks a lot. In the disk utility I got: /PCI0@0/EUSB@1D,7
And in the DSDT file, at Device(EUSB) I don't have a lot of things. Just

{
Name (_ADR, 0x001D0007)
}

nothing else. Any idea what else I can add to make it working in that case ?

Заметка #83 @kizwan 2010-03-20 ↳ Re: @richarda
@richardaThanks a lot. In the disk utility I got: /PCI0@0/EUSB@1D,7 And in the DSDT file, at Device(EUSB) I don't have a lot of things. Just { Name (_ADR, 0x001D0007) } nothing else. Any idea what else I can add to make it working in that case ?

You're allowed to add what it don't have.

kizwan

Заметка #84 @richarda 2010-03-20

Allright, I got that but in this case I guess I have to pute something like

Name(_PRW, Package
{
<xx>, // Bit number in GPEx_EN to enable USB resume
0x01 // Reference to lowest sleeping state which can be
// entered while still providing wake functionality
// no relative power resource specified
})

But how to determine the <xx> value then ?

Заметка #85 @uman 2010-03-21 ↳ Re: @richarda
@richardaAllright, I got that but in this case I guess I have to pute something like Name(_PRW, Package { <xx>, // Bit number in GPEx_EN to enable USB resume 0x01 // Reference to lowest sleeping state which can be // entered while still providing wake functionality // no relative power resource specified }) But how to determine the <xx> value…

That's the problem then. You really need to have some of the resources specified for your USB (UHCI) and EHCI ports. Since you don't have anything, you can add the GPE handlers, and things should work. The best way to proceed, is to first identify which Mac model your machine is closest to, and then take the requisite parts, carefully excising out the problematic parts.

For my hack, I looked at the list of mac models on wikipedia, and then chose MacBook 2,1 as the closest. I then edited my smbios.plist to reflect those values. I then compared my DSDT to the MacBook 2,1 DSDT and ioreg, and found they were surprisingly close. I've included below, some pieces for you to try from a MacBook 2,1 DSDT:

    Scope (\_GPE)
    {
...
        Method (_L03, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB1, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

        Method (_L04, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB2, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }
...
        Method (_L0C, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB3, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

        Method (_L0D, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB7, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

        Method (_L0E, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB4, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }
...

Note the parts in red. If you already have level handlers in your GPE scope that use these numbers (so say you already have _L03), you will have to change them, and change the part in the USB1 declaration for, say, _L03. Don't put really large numbers, because there's a part in the DSDT that says the handlers go only up to 0xXX (I've forgotten where that is). Just make sure you use unused numbers. For example, in my DSDT I added one for _L11 for my firewire.

            Device (USB1)
            {
                Name (_ADR, 0x001D0000)  // keep your existing ADDR lines!!!
                Device (HUB1)                       // will become HUB2 for USB2
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }
                }

                OperationRegion (U1CS, PCI_Config, 0xC4, 0x04)
                Field (U1CS, DWordAcc, NoLock, Preserve)
                {
                    U1EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x03,     // must match number you use in _Lxx handler
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x03, U1EN)
                    }
                    Else
                    {
                        Store (0x00, U1EN)
                    }
                }

                Method (_S3D, 0, NotSerialized)  // note: I don't have these
                {
                    Return (0x03)
                }

                Method (_S4D, 0, NotSerialized) // note: I don't have these
                {
                    Return (0x03)
                }
            }

The parts in red will change to match each USB port, so U1CS, U1EN becomes U2CS and U2EN for USB2, along with changing HUB1 to HUB2. I don't have the _S3D and _S4D methods in my DSDT and from reading the spec, I don't think they are needed.

So USB2, looks like:

            Device (USB2)
            {
                Name (_ADR, 0x001D0001)
                Device (HUB2)
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }
                }

                OperationRegion (U2CS, PCI_Config, 0xC4, 0x04)
                Field (U2CS, DWordAcc, NoLock, Preserve)
                {
                    U2EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x04,      // A different _L04 is a different _LXX handler than USB1!
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x03, U2EN)
                    }
                    Else
                    {
                        Store (0x00, U2EN)
                    }
                }

                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x03)
                }

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x03)
                }
            }

Do the same edits for USB3 and USB4 (if you have USB4) and even USB5, and USB6 if you have a desktop with lots of USB ports (although I suspect you will need another EHCI hub there, but I don't know).

USB7 is quite different:

            Device (USB7)
            {
                Name (_ADR, 0x001D0007)
                Device (HUB7)
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }

                    Device (PRT3)
                    {
                        Name (_ADR, 0x03)
                    }

                    Device (PRT4)
                    {
                        Name (_ADR, 0x04)
                    }

                    Device (PRT5)
                    {
                        Name (_ADR, 0x05)
                    }

                    Device (PRT6)
                    {
                        Name (_ADR, 0x06)
                    }

                    Device (PRT7)
                    {
                        Name (_ADR, 0x07)
                    }

                    Device (PRT8)
                    {
                        Name (_ADR, 0x08)
                    }
                }

                Name (_PRW, Package (0x02)
                {
                    0x0D,     // yet another different handler
                    0x03      // I suggested you change this to 0x1
                })
                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x03)
                }

                  Method (_S4D, 0, NotSerialized)
                {
                    Return (0x03)
                }
            }

Remove the parts in yellow for the USB7, since they don't match the change from 0x03 -> 0x01. Plus I suspect they really aren't needed.

Заметка #86 @uman 2010-03-21

Oh, and if this doesn't work, there are bits you can set that essentially control power settings, ejectability, etc. But that is hugely dependent on your chipset. I have an ICH7, and most of that is the same in ICH9, and ICH10, but if you have an nvidia chipset, that's *totally* different.

Заметка #87 @richarda 2010-03-21

OK, I'm 200% lost now. This is way too complex for me. I guess I have to find somebody litterate enough who solved the problem on the eee901 and just copy his settings.

Thanks anyway.

Заметка #88 @barnum 2010-03-26
                Device (HUB1)                       // will become HUB2 for USB2
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }
                }

Hi,
Can You explain me what the "utility" of this part of the usb declaration"

In my dsdt, I doesn't have that.
Thank,
Barnum

Заметка #89 @uman 2010-03-29

You won't need it, then. It's because on my gateway, the ports have integrated hubs. See ACPI spec, section 9.13 for full details.

Заметка #90 @adriangb 2010-04-01 ↳ Re: @ping99

Sorry of reviving this and cutting in
@ping99
I have an ASRock x58 Extreme (similar to ASUS boards), and sleep doesn't work OTB. I've been looking around, and it seems I would need to modify Method (_PTS, 1, NotSerialized).
I read your post, and it seems that the edits you did are somewhat similar to what I should do in my DSDT, whoever I have a few doubts:

@ping99... 1 Add OperationRegion below before Method (_PTS, 1, NotSerialized) OperationRegion (DEBG, SystemIO, 0x80, One) Field (DEBG, ByteAcc, NoLock, Preserve) { DBG1, 8 } OperationRegion (PMRS, SystemIO, 0x0430, 0x13) Field (PMRS, ByteAcc, NoLock, Preserve) { , 4, SLPE, 1, Offset (0x08), GPSE, 16, GPSS, 16, Offset (0x12), , 1, SWGC, 1 }

Is

OperationRegion (DEBG, SystemIO, 0x80, One)
    Field (DEBG, ByteAcc, NoLock, Preserve)
    {
        DBG1,   8
    }

really necessary? mm67 seems to think not (or is that for shutdown only?)

@ping99...2 Check Device (LPC) if there is a similar Operation Region "LPC" like below. If you don't have LPC device, just search Name (_ADR, 0x001F0000), sometimes the device name is different. Device (LPC) { Name (_ADR, 0x001F0000) OperationRegion (LPC0, PCI_Config, 0xA4, 0x02) Field (LPC0, ByteAcc, NoLock, Preserve) { AG3E, 1 } If there…

Here is my LPCB:

Device (LPCB)
            {
                Name (_ADR, 0x001F0000)
                Device (IELK)
                {
                    Name (_HID, "AWY0001")
                    OperationRegion (RXA0, PCI_Config, 0xA0, 0x20)
                    Field (RXA0, ByteAcc, NoLock, Preserve)
                    {
                            ,   9, 
                        PBLV,   1, 
                                Offset (0x10), 
                            ,   1, 
                        PBMS,   1, 
                            ,   1, 
                        PMCS,   1, 
                        ECNS,   1, 
                                Offset (0x11), 
                        ECT1,   16, 
                        ELEN,   1, 
                                Offset (0x14)
                    }

                    Method (\_GPE._L0A, 0, NotSerialized)....

Where should I put OperationRegion (LPC0...? Before Device (IELK)? After Name (_HID, "AWY0001")? Inside OperationRegion (RXA0, PCI_Config, 0xA0, 0x20) somehow?

@ping993 Add code below in Method (_PTS, 1, NotSerialized) like this Method (_PTS, 1, NotSerialized) { Or (Arg0, 0xF0, Local0) Store (Local0, DBG1) Store (Zero, \_SB.PCI0.LPC.EXPE) //Please change to \_SB.PCI0.LPC.AG3E if you don't have the EXPE, but add AG3E. If (LEqual (Arg0, 0x05)) { Store (Zero, SLPE) Sleep(0x10) } Else { //**Original…

Here is my current -disastrous- Method (_PTS, 1, NotSerialized):

Method (_PTS, 1, NotSerialized)
    {
        Or (Arg0, 0xF0, Local0)
        Store (Arg0, DBG8)
        PTS (Arg0)
        Store (Zero, Index (WAKP, Zero))
        Store (Zero, Index (WAKP, One))
        If (LAnd (LEqual (Arg0, 0x04), LEqual (OSFL (), 0x02)))
        {
            Sleep (0x0BB8)
        }

        If (LEqual (Arg0, 0x05))
        {
            Store (0x99, SMIP)
            Store (One, \_SB.PCI0.LPCB.IELK.AG3E)
            Store (Zero, SLPE)
            Sleep (0x10)
        }
        Else
        {
            Store (Zero, \_SB.PCI0.LPCB.IELK.AG3E)
        }
        Store (ASSB, WSSB)
        OSYS ()
        Store (AOTB, WOTB)
        Store (AAXB, WAXB)
        Store (Arg0, ASSB)
        Store (OSFL (), AOTB)
        Store (OSYS (), OSTP)
        Store (Zero, AAXB)
    }

The original is:

Method (_PTS, 1, NotSerialized)
    {
        Store (Arg0, DBG8)
        PTS (Arg0)
        Store (Zero, Index (WAKP, Zero))
        Store (Zero, Index (WAKP, One))
        If (LAnd (LEqual (Arg0, 0x04), LEqual (OSFL (), 0x02)))
        {
            Sleep (0x0BB8)
        }

        Store (ASSB, WSSB)
        Store (AOTB, WOTB)
        Store (AAXB, WAXB)
        Store (Arg0, ASSB)
        Store (OSFL (), AOTB)
        Store (OSYS (), OSTP)
        Store (Zero, AAXB)
    }

, Adrian

Post Scriptum (P.S.): I attached my DSDT's, CST and IST tables, so if someone could lok at them and tell me if I -for example- managed to insert the C-States, P-States, etc-States into the DSDT correctly, I would be eternally grateful.

Заметка #91 @ping99 2010-07-04

First all, you just need to add OperationRegion PMRS below.

OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
Field (PMRS, ByteAcc, NoLock, Preserve)
{
, 4,
SLPE, 1
}

* Pay attention to 0x0430 in red. It depends your motherboard. You have Processor (CPU0, 0x00, 0x00000410, 0x06) in your dsdt, you can use 0x0430. If you have Processor (P001, 0x01, 0x00000810, 0x06) then use 0x0830. It is PMBASE+30h.

Secondly, look into Method (_PTS, 1, NotSerialized) to see whether "If (LEqual (Arg0, 0x05))" there. If not, add code as below. If already there, just insert.

If (LEqual (Arg0, 0x05))
{
Store (0x01, \_SB.PCI0.LPC.EXPE) // hibernate fix. Will return to S5 after power back
Store (Zero, SLPE) // zero SLP_SMI_EN, else won't shutdown
Sleep (0x10) // wait for bit to set
}

Yours is modified as below:

Method (_PTS, 1, NotSerialized)
{
Store (Zero, \_SB.PCI0.LPC.EXPE) //Check Device (LPC) or LPCB if you have this EXPE or something like this. change it to match yours.
If (LEqual (Arg0, 0x05))
{
Store (0x01, \_SB.PCI0.LPC.EXPE) // hibernate fix. Will return to S5 after power back
Store (Zero, SLPE) // zero SLP_SMI_EN, else won't shutdown
Sleep (0x10) // wait for bit to set
}

Store (Arg0, DBG8)
PTS (Arg0)
Store (Zero, Index (WAKP, Zero))
Store (Zero, Index (WAKP, One))
If (LAnd (LEqual (Arg0, 0x04), LEqual (OSFL , 0x02)))
{
Sleep (0x0BB8)
}

Store (ASSB, WSSB)
Store (AOTB, WOTB)
Store (AAXB, WAXB)
Store (Arg0, ASSB)
Store (OSFL , AOTB)
Store (OSYS , OSTP)
Store (Zero, AAXB)
}

Заметка #92 @SaGaR 2010-12-20

i tried the sleep fix, but i can't get it to work, sleep in general doesn't work, when i press the sleep button, my screen freezes and that's all, when i press the powerbutton i get the restart/shutdown popup and all works again.

Lidsleep also does the same, screen freezes but stays on.

i wanna ask you if you plz wanna look at it?

Заметка #93 @ribben89 2011-02-05

really nice job!

Here is my problem... I have a Compal Ifl90 with intel 7300 @ 2GHz and 8600m gt 512mb with Snow Leopard 10.6.3 .

The problem i have is that my screen brightness slider at setting wasn't there! But with some dsdt editing i managed to show up but when i move the slider nothing happen and returns to it's original position! Any help please below is my code from Device (LCD)

Device (LCD)
                    {
                        Method (_ADR, 0, NotSerialized)
                        {
                            Return (0x0110)
                        }

                        Method (_DCS, 0, NotSerialized)
                        {
                            ^^^^LPCB.PHSS (0x0C)
                            Store (CADL, Local0)
                            Store (CSTE, Local1)
                            And (Local0, One, Local0)
                            And (Local1, One, Local1)
                            If (Local0)
                            {
                                Store (One, LCDA)
                            }
                            Else
                            {
                                Store (Zero, LCDA)
                            }

                            If (LCDA)
                            {
                                If (LEqual (Local1, One))
                                {
                                    Return (0x1F)
                                }
                                Else
                                {
                                    Return (0x1D)
                                }
                            }
                            Else
                            {
                                If (LEqual (Local1, One))
                                {
                                    Return (0x0F)
                                }
                                Else
                                {
                                    Return (0x0D)
                                }
                            }
                        }

                        Method (_DGS, 0, NotSerialized)
                        {
                            If (LCDA)
                            {
                                Return (One)
                            }
                            Else
                            {
                                Return (Zero)
                            }
                        }

                        Method (_DSS, 1, NotSerialized)
                        {
                        }

                        Method (_BCL, 0, NotSerialized)
                        {
                            If (^^^^LPCB.ECOK ())
                            {
                                If (LEqual (OSYS, 0x07D6))
                                {
                                    If (LEqual (^^^^LPCB.EC0.OSTY, Zero))
                                    {
                                        Store (One, ^^^^LPCB.EC0.OSTY)
                                    }
                                }
                                Else
                                {
                                    If (LEqual (^^^^LPCB.EC0.OSTY, One))
                                    {
                                        Store (Zero, ^^^^LPCB.EC0.OSTY)
                                    }
                                }
                            }

                            Return (Package (0x0A)
                            {
                                0x46, 
                                0x28, 
                                Zero, 
                                0x0A, 
                                0x14, 
                                0x1E, 
                                0x28, 
                                0x32, 
                                0x3C, 
                                0x46
                            })
                        }

                        Method (_BCM, 1, NotSerialized)
                        {
                            Divide (Arg0, 0x0A, Local0, Local1)
                            Store (Local1, ^^^^LPCB.EC0.BRTS)
                        }

                        Method (_BQC, 0, NotSerialized)
                        {
                            Multiply (^^^^LPCB.EC0.BRTS, 0x0A, Local0)
                            Return (Local0)
                        }
                    }

In my try to make it show up i also added

Name (_HID, EisaId ("LCD1234"))

in Device (LCD)

And

Device (PNLF)
                    {
                        Name (_HID, EisaId ("APP0002"))
                        Name (_CID, "backlight")
                        Name (_UID, 0x0A)
                        Name (_STA, 0x0B)
                    }

right above Device (LCD)

Also i am able to change brightness from my Fn Buttons but no notification is shows as the sound changing does!

Please any ideas?

Заметка #94 @Marchrius 2013-01-21

Led Wireless

How I can turn on wireless led with code in DSDT?

Проверили и дополнили материал: @Thireus @uman @THeKiNG @pocenk @adriangb
Источники и реестр соавторов (указано участников: 32 · Тема #1960)
УчастникРоль в досьеСообщенийПериод активности
@umanКлючевой участник212009-06-02 → 2010-03-29
@kizwanКлючевой участник182009-06-01 → 2010-03-20
@pentiumpcОсновной автор82009-01-19 → 2009-03-03
@Slither2008Ключевой участник62009-03-03 → 2009-03-05
@candykaneКлючевой участник62009-05-13
@richardaКлючевой участник52010-03-16 → 2010-03-21
@THeKiNGКлючевой участник42009-06-03 → 2009-06-18
@breakkyКлючевой участник42010-03-13 → 2010-03-14
@ThireusКлючевой участник32009-05-07 → 2009-05-13
@AlexaarУчастник22009-04-13 → 2009-04-29
@The Edge3000Участник22009-08-11 → 2009-09-07
@GurruwiwiУчастник22009-08-17
@EnzoFXУчастник22009-09-03
@SweatyУчастник22009-12-21
@ping99Участник22010-01-18 → 2010-07-04
@NameciУчастник22010-01-31
@barnumУчастник22010-03-13 → 2010-03-26
@adriangbУчастник22010-04-01
@kDawgУчастник12009-07-15
@aschar1Участник12009-08-07
@sk1nhd33tУчастник12009-08-09
@Common_SenseУчастник12009-09-08
@gnychisУчастник12009-09-25
@msinghУчастник12009-10-05
@2nerd4uУчастник12009-10-20
@mm67Участник12009-12-21
@adityaxavierУчастник12010-01-09
@pocenkУчастник12010-01-29
@saul1dУчастник12010-03-20
@SaGaRУчастник12010-12-20
@ribben89Участник12011-02-05
@MarchriusУчастник12013-01-21

Выберите язык · Choose your language