All of lore.kernel.org
 help / color / mirror / Atom feed
* [WM5102/ARIZONA] spi driver needs to support ACPI
@ 2015-05-15  9:16 Christian Hartmann
  2015-05-18 16:29 ` Pierre-Louis Bossart
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Hartmann @ 2015-05-15  9:16 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 5515 bytes --]

Hi list,


I need ACPI support for the arizona-core / arizona-spi driver for the
ACPI ID WM5102.
This audio codec is build into the Lenovo Yoga 851F. This device is a
32Bit (UEFI) system

http://support.lenovo.com/de/de/products/tablets/yoga-series/yoga-tablet-2-851


I have tested with vanilla kernels from kernel.org 3.19.y ,4.0.y and
master (from torvalds) currently its 4.1.0-rc3. As distribution I am
working with Fedora / Fedlet was the initial install image.

With all vanilla kernels I got at first an error message from spi32766:

[    0.296297] pxa2xx-spi 80860F0E:00: cs1 >= max 1
[    0.296311] spi_master spi32766: failed to add SPI device
WM510205:00 from ACPI

so I have at first patched as suggested by broonie the arizona-core

commit 48203a0fede057d6a8c5f6872c53326395350f45
Author: somebody anybody <somebody@foobar.com>
Date:   Mon May 11 13:35:43 2015 +0200

    spi-pxa2xx : raise chipselect

    Signed-off-by: somebody anybody <somebody@foobar.com>

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index e3223ac..9c919ea 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1279,7 +1279,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
        if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0, &devid))
                ssp->port_id = devid;

-       pdata->num_chipselect = 1;
+       pdata->num_chipselect = 20;
        pdata->enable_dma = true;

        return pdata;

This leds the spi master do the further ACPI configuration and inital
setup for the arizona-spi device, but adding the ACPI ID to it
does not work yet as expected:

The current last patchset on top of master is


Author: somebody anybody <somebody@foobar.com>
Date:   Wed May 13 11:36:25 2015 +0200

    arizona : added ACPI id of wm5102 to SPI driver, too

    Signed-off-by: somebody anybody <somebody@foobar.com>

diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
index 1e845f6..c19a4c1 100644
--- a/drivers/mfd/arizona-spi.c
+++ b/drivers/mfd/arizona-spi.c
@@ -17,6 +17,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 #include <linux/spi/spi.h>
+#include <linux/acpi.h>
 #include <linux/of.h>

 #include <linux/mfd/arizona/core.h>
@@ -82,6 +83,15 @@ static int arizona_spi_remove(struct spi_device *spi)
        return 0;
 }

+#ifdef CONFIG_ACPI
+static struct acpi_device_id wm5102_acpi_match[] = {
+               { "WM5102", 0},
+               { "WM510205", 0},
+               { },
+};
+MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
+#endif
+
 static const struct spi_device_id arizona_spi_ids[] = {
        { "wm5102", WM5102 },
        { "wm5110", WM5110 },
@@ -96,6 +106,9 @@ static struct spi_driver arizona_spi_driver = {
                .owner  = THIS_MODULE,
                .pm     = &arizona_pm_ops,
                .of_match_table = of_match_ptr(arizona_of_match),
+#ifdef CONFIG_ACPI
+               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
+#endif
        },
        .probe          = arizona_spi_probe,
        .remove         = arizona_spi_remove,




commit 268e21d29c942205e40f749c6d71c77839dc67da
Author: somebody anybody <somebody@foobar.com>
Date:   Wed May 13 11:36:04 2015 +0200

    arizona : added ACPI id of wm5102 to i2c driver

    Signed-off-by: somebody anybody <somebody@foobar.com>

diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
index ff782a5..45ece1b 100644
--- a/drivers/mfd/arizona-i2c.c
+++ b/drivers/mfd/arizona-i2c.c
@@ -18,6 +18,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 #include <linux/of.h>
+#include <linux/acpi.h>

 #include <linux/mfd/arizona/core.h>

@@ -85,6 +86,15 @@ static int arizona_i2c_remove(struct i2c_client *i2c)
        return 0;
 }

+#ifdef CONFIG_ACPI
+static struct acpi_device_id wm5102_acpi_match[] = {
+               { "WM5102", 0},
+               { "WM510205", 0},
+               { },
+};
+MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
+#endif
+
 static const struct i2c_device_id arizona_i2c_id[] = {
        { "wm5102", WM5102 },
        { "wm5110", WM5110 },
@@ -100,6 +110,9 @@ static struct i2c_driver arizona_i2c_driver = {
                .owner  = THIS_MODULE,
                .pm     = &arizona_pm_ops,
                .of_match_table = of_match_ptr(arizona_of_match),
+#ifdef CONFIG_ACPI
+               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
+#endif
        },
        .probe          = arizona_i2c_probe,
        .remove         = arizona_i2c_remove,



with these two patches the local master branch compiles fine, but at
initialzing the arizona-spi driver gots a NULL pointer exception.

I attach the whole dmesg of 4.1.0-rc3 (build 4.1.0.24-rc3).

I need some assistance or hints to the right direction, I am looking
myself and I also try what I can, but I think it would be easy peasy
with some experts like here on this list :)


PS: the message : spi_master spi32766: raised num_chipselect to 20 for
WM510205:00

is a dev_err() line added to the function static acpi_status
acpi_spi_add_device(), there I had raised the num_chipselect first
(that was wrong, the raise is now done as in the first patch above.
this is only a debug message and will be removed soon)


PPS: for me it seems that there is a missing 'link' from WM5102 to the
sst-acpi 80860F28:00 device, which complaints NOW / the first time
with the three patches applied on top on master.... will have a look
into it.

I hope I got this device working with some more help from you.

cheers
chris

[-- Attachment #2: dmesg.txt --]
[-- Type: text/plain, Size: 61038 bytes --]

[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.1.0.26-rc3 (b23@berkelium.fyedot.greenzone) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #127 SMP Wed May 13 15:19:39 CEST 2015
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000008efff] usable
[    0.000000] BIOS-e820: [mem 0x000000000008f000-0x000000000008ffff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x0000000000090000-0x000000000009dfff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009e000-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001fffffff] usable
[    0.000000] BIOS-e820: [mem 0x0000000020000000-0x00000000201fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000020200000-0x00000000782d5fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000782d6000-0x0000000078bd5fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000078bd6000-0x0000000078cd5fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x0000000078cd6000-0x0000000078d15fff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000078d16000-0x000000007950efff] usable
[    0.000000] BIOS-e820: [mem 0x000000007950f000-0x0000000079e0efff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x0000000079e0f000-0x0000000079ffffff] usable
[    0.000000] BIOS-e820: [mem 0x000000007a800000-0x000000007acfffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000e00f8000-0x00000000e00f8fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fed01000-0x00000000fed01fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000ffd00000-0x00000000ffffffff] reserved
[    0.000000] Notice: NX (Execute Disable) protection cannot be enabled: non-PAE kernel!
[    0.000000] efi: EFI v2.40 by INSYDE Corp.
[    0.000000] efi:  ACPI 2.0=0x78d15014  SMBIOS=0x7878a000 
[    0.000000] SMBIOS 2.7 present.
[    0.000000] DMI: LENOVO 60072/INVALID, BIOS 02WT18WW 08/01/2014
[    0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000000] e820: last_pfn = 0x7ad00 max_arch_pfn = 0x100000
[    0.000000] MTRR default type: uncachable
[    0.000000] MTRR fixed ranges enabled:
[    0.000000]   00000-9FFFF write-back
[    0.000000]   A0000-FFFFF write-protect
[    0.000000] MTRR variable ranges enabled:
[    0.000000]   0 base 0FFD00000 mask FFFC00000 write-protect
[    0.000000]   1 base 000000000 mask FC0000000 write-back
[    0.000000]   2 base 040000000 mask FE0000000 write-back
[    0.000000]   3 base 060000000 mask FF0000000 write-back
[    0.000000]   4 base 070000000 mask FF8000000 write-back
[    0.000000]   5 base 078000000 mask FFC000000 write-back
[    0.000000]   6 base 07B000000 mask FFF000000 uncachable
[    0.000000]   7 base 07AE00000 mask FFFE00000 uncachable
[    0.000000] PAT configuration [0-7]: WB  WC  UC- UC  WB  WC  UC- UC  
[    0.000000] initial memory mapped: [mem 0x00000000-0x013fffff]
[    0.000000] Base memory trampoline at [c009a000] 9a000 size 16384
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[    0.000000]  [mem 0x00000000-0x000fffff] page 4k
[    0.000000] init_memory_mapping: [mem 0x36c00000-0x36ffffff]
[    0.000000]  [mem 0x36c00000-0x36ffffff] page 4M
[    0.000000] init_memory_mapping: [mem 0x00100000-0x1fffffff]
[    0.000000]  [mem 0x00100000-0x003fffff] page 4k
[    0.000000]  [mem 0x00400000-0x1fffffff] page 4M
[    0.000000] init_memory_mapping: [mem 0x20200000-0x36bfffff]
[    0.000000]  [mem 0x20200000-0x203fffff] page 4k
[    0.000000]  [mem 0x20400000-0x36bfffff] page 4M
[    0.000000] BRK [0x010af000, 0x010affff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0x37000000-0x373fdfff]
[    0.000000]  [mem 0x37000000-0x373fdfff] page 4k
[    0.000000] BRK [0x010b0000, 0x010b0fff] PGTABLE
[    0.000000] BRK [0x010b1000, 0x010b2fff] PGTABLE
[    0.000000] RAMDISK: [mem 0x3ef4c000-0x3fffafff]
[    0.000000] Allocated new RAMDISK: [mem 0x3634f000-0x373fdd4f]
[    0.000000] Move RAMDISK from [mem 0x3ef4c000-0x3fffad4f] to [mem 0x3634f000-0x373fdd4f]
[    0.000000] ACPI: Early table checksum verification disabled
[    0.000000] ACPI: RSDP 0x0000000078D15014 000024 (v02 LENOVO)
[    0.000000] ACPI: XSDT 0x0000000078CF3188 0000DC (v01 LENOVO CS-02    00000001      01000013)
[    0.000000] ACPI: FACP 0x0000000078D0F000 00010C (v05 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: DSDT 0x0000000078CFF000 00A6B5 (v02 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: UEFI 0x0000000078D14000 000236 (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: TCPA 0x0000000078D13000 000032 (v02 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: MSDM 0x0000000078D12000 000055 (v03 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: UEFI 0x0000000078D11000 000042 (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: DBG2 0x0000000078D10000 000072 (v00 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: HPET 0x0000000078D0E000 000038 (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: LPIT 0x0000000078D0D000 000104 (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: APIC 0x0000000078D0C000 00006C (v03 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: MCFG 0x0000000078D0B000 00003C (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: SLIC 0x0000000078D0A000 000176 (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: SSDT 0x0000000078CFE000 0005FB (v01 LENOVO CpuDptf  00000003 ACPI 00040000)
[    0.000000] ACPI: SSDT 0x0000000078CFC000 0018BD (v01 LENOVO DptfTab  00000003 ACPI 00040000)
[    0.000000] ACPI: SSDT 0x0000000078CFB000 000058 (v01 LENOVO LowPwrM  00000003 ACPI 00040000)
[    0.000000] ACPI: SSDT 0x0000000078CFA000 0000FF (v01 LENOVO SoCDptf  00000003 ACPI 00040000)
[    0.000000] ACPI: SSDT 0x0000000078CF9000 00043A (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: TPM2 0x0000000078CF8000 000034 (v03 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: SSDT 0x0000000078CF7000 000763 (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: SSDT 0x0000000078CF6000 000290 (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: SSDT 0x0000000078CF5000 00017A (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: FPDT 0x0000000078CF4000 000044 (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: CSRT 0x0000000078CF2000 00014C (v00 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: BGRT 0x0000000078CF1000 000038 (v01 LENOVO CS-02    00000001 ACPI 00040000)
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] 1081MB HIGHMEM available.
[    0.000000] 883MB LOWMEM available.
[    0.000000]   mapped low ram: 0 - 373fe000
[    0.000000]   low ram: 0 - 373fe000
[    0.000000] BRK [0x010b3000, 0x010b3fff] PGTABLE
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.000000]   Normal   [mem 0x0000000001000000-0x00000000373fdfff]
[    0.000000]   HighMem  [mem 0x00000000373fe000-0x000000007acfffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000001000-0x000000000008efff]
[    0.000000]   node   0: [mem 0x0000000000090000-0x000000000009dfff]
[    0.000000]   node   0: [mem 0x0000000000100000-0x000000001fffffff]
[    0.000000]   node   0: [mem 0x0000000020200000-0x00000000782d5fff]
[    0.000000]   node   0: [mem 0x0000000078d16000-0x000000007950efff]
[    0.000000]   node   0: [mem 0x0000000079e0f000-0x0000000079ffffff]
[    0.000000]   node   0: [mem 0x000000007a800000-0x000000007acfffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x000000007acfffff]
[    0.000000] On node 0 totalpages: 495452
[    0.000000] free_area_init_node: node 0, pgdat c0edd440, node_mem_map f5017028
[    0.000000]   DMA zone: 40 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 3996 pages, LIFO batch:0
[    0.000000]   Normal zone: 2170 pages used for memmap
[    0.000000]   Normal zone: 221694 pages, LIFO batch:31
[    0.000000]   HighMem zone: 269762 pages, LIFO batch:31
[    0.000000] Using APIC driver default
[    0.000000] x86/hpet: Will disable the HPET for this platform because it's not reliable
[    0.000000] Reserving Intel graphics stolen memory at 0x7af00000-0x7eefffff
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-86
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.000000] smpboot: Allowing 4 CPUs, 0 hotplug CPUs
[    0.000000] PM: Registered nosave memory: [mem 0x00000000-0x00000fff]
[    0.000000] PM: Registered nosave memory: [mem 0x0008f000-0x0008ffff]
[    0.000000] PM: Registered nosave memory: [mem 0x0009e000-0x0009ffff]
[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000fffff]
[    0.000000] PM: Registered nosave memory: [mem 0x20000000-0x201fffff]
[    0.000000] e820: [mem 0x7ef00000-0xe00f7fff] available for PCI devices
[    0.000000] clocksource refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    0.000000] setup_percpu: NR_CPUS:32 nr_cpumask_bits:32 nr_cpu_ids:4 nr_node_ids:1
[    0.000000] PERCPU: Embedded 19 pages/cpu @f4fb6000 s45528 r0 d32296 u77824
[    0.000000] pcpu-alloc: s45528 r0 d32296 u77824 alloc=19*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 493242
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.1.0.26-rc3 root=UUID=6c3bcf92-5a26-4dde-95e3-78ceb9aaa35b ro i915.modeset=0 rhgb quiet i915.force_backlight_pmic=1 audit=1 enforcing=1 selinux=1 LANG=de_DE.UTF-8
[    0.000000] audit: enabled (after initialization)
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Initializing CPU#0
[    0.000000] Initializing HighMem for node 0 (000373fe:0007ad00)
[    0.000000] Initializing Movable for node 0 (00000000:00000000)
[    0.000000] Memory: 1900596K/1981808K available (7412K kernel code, 755K rwdata, 3068K rodata, 796K init, 896K bss, 81212K reserved, 0K cma-reserved, 1048856K highmem)
[    0.000000] virtual kernel memory layout:
    fixmap  : 0xffa96000 - 0xfffff000   (5540 kB)
    pkmap   : 0xff400000 - 0xff800000   (4096 kB)
    vmalloc : 0xf7bfe000 - 0xff3fe000   ( 120 MB)
    lowmem  : 0xc0000000 - 0xf73fe000   ( 883 MB)
      .init : 0xc0efc000 - 0xc0fc3000   ( 796 kB)
      .data : 0xc0b3d36a - 0xc0efafc0   (3831 kB)
      .text : 0xc0400000 - 0xc0b3d36a   (7412 kB)
[    0.000000] Checking if this processor honours the WP bit even in supervisor mode...Ok.
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	RCU dyntick-idle grace-period acceleration is enabled.
[    0.000000] 	RCU restricting CPUs from NR_CPUS=32 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS:2304 nr_irqs:1024 0
[    0.000000] CPU 0 irqstacks, hard=f4836000 soft=f483c000
[    0.000000] 	Offload RCU callbacks from all CPUs
[    0.000000] 	Offload RCU callbacks from CPUs: 0-3.
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] Maximum core-clock to bus-clock ratio: 0xa
[    0.000000] Resolved frequency ID: 2, frequency: 133200 KHz
[    0.000000] TSC runs at 1332000 KHz
[    0.000000] lapic_timer_frequency = 133200
[    0.000000] tsc: Detected 1332.000 MHz processor
[    0.000045] Calibrating delay loop (skipped), value calculated using timer frequency.. 2664.00 BogoMIPS (lpj=1332000)
[    0.000055] pid_max: default: 32768 minimum: 301
[    0.000072] ACPI: Core revision 20150410
[    0.035735] ACPI: All ACPI Tables successfully acquired
[    0.036960] Security Framework initialized
[    0.036976] SELinux:  Initializing.
[    0.036995] SELinux:  Starting in enforcing mode
[    0.037095] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.037102] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.037555] Initializing cgroup subsys blkio
[    0.037565] Initializing cgroup subsys memory
[    0.037585] Initializing cgroup subsys devices
[    0.037594] Initializing cgroup subsys freezer
[    0.037602] Initializing cgroup subsys net_cls
[    0.037610] Initializing cgroup subsys perf_event
[    0.037619] Initializing cgroup subsys net_prio
[    0.037663] CPU: Physical Processor ID: 0
[    0.037668] CPU: Processor Core ID: 0
[    0.037675] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
[    0.037679] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
[    0.049693] mce: CPU supports 6 MCE banks
[    0.049707] CPU0: Thermal monitoring enabled (TM1)
[    0.049714] process: using mwait in idle threads
[    0.049724] Last level iTLB entries: 4KB 48, 2MB 0, 4MB 0
[    0.049729] Last level dTLB entries: 4KB 128, 2MB 16, 4MB 16, 1GB 0
[    0.050076] Freeing SMP alternatives memory: 24K (c0fc3000 - c0fc9000)
[    0.050102] Ignoring BGRT: invalid status 0 (expected 1)
[    0.053353] ftrace: allocating 30256 entries in 60 pages
[    0.079723] Enabling APIC mode:  Flat.  Using 1 I/O APICs
[    0.079783] TSC deadline timer enabled
[    0.079790] smpboot: CPU0: Intel(R) Atom(TM) CPU  Z3745  @ 1.33GHz (fam: 06, model: 37, stepping: 08)
[    0.079843] Performance Events: PEBS fmt2+, 8-deep LBR, Silvermont events, full-width counters, Intel PMU driver.
[    0.079866] ... version:                3
[    0.079870] ... bit width:              40
[    0.079874] ... generic registers:      2
[    0.079878] ... value mask:             000000ffffffffff
[    0.079881] ... max period:             000000ffffffffff
[    0.079885] ... fixed-purpose events:   3
[    0.079889] ... event mask:             0000000700000003
[    0.082421] CPU 1 irqstacks, hard=f4968000 soft=f496a000
[    0.082428] x86: Booting SMP configuration:
[    0.082433] .... node  #0, CPUs:      #1
[    0.093458] Initializing CPU#1
[    0.107744] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
[    0.108123] CPU 2 irqstacks, hard=f4a14000 soft=f4a16000
[    0.108129]  #2
[    0.119149] Initializing CPU#2
[    0.133576] CPU 3 irqstacks, hard=f4a58000 soft=f4a5a000
[    0.133584]  #3
[    0.144604] Initializing CPU#3
[    0.158814] x86: Booted up 1 node, 4 CPUs
[    0.158824] smpboot: Total of 4 processors activated (10656.00 BogoMIPS)
[    0.160049] devtmpfs: initialized
[    0.161009] PM: Registering ACPI NVS region [mem 0x0008f000-0x0008ffff] (4096 bytes)
[    0.161017] PM: Registering ACPI NVS region [mem 0x78bd6000-0x78cd5fff] (1048576 bytes)
[    0.161063] PM: Registering ACPI NVS region [mem 0x7950f000-0x79e0efff] (9437184 bytes)
[    0.161654] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[    0.161924] atomic64_test: passed for i586+ platform with CX8 and with SSE
[    0.161933] pinctrl core: initialized pinctrl subsystem
[    0.162225] RTC time: 15:48:06, date: 05/13/15
[    0.162667] NET: Registered protocol family 16
[    0.165873] cpuidle: using governor menu
[    0.166238] ACPI: bus type PCI registered
[    0.166245] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.166470] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xe0000000-0xe3ffffff] (base 0xe0000000)
[    0.166478] PCI: not using MMCONFIG
[    0.166817] PCI: Using configuration type 1 for base access
[    0.177009] ACPI: Added _OSI(Module Device)
[    0.177017] ACPI: Added _OSI(Processor Device)
[    0.177022] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.177027] ACPI: Added _OSI(Processor Aggregator Device)
[    0.203417] ACPI: Dynamic OEM Table Load:
[    0.203457] ACPI: SSDT 0x00000000F4A8F000 000338 (v01 PmRef  Cpu0Ist  00003000 INTL 20130117)
[    0.205453] ACPI: Dynamic OEM Table Load:
[    0.205490] ACPI: SSDT 0x00000000F4812000 000433 (v01 PmRef  Cpu0Cst  00003001 INTL 20130117)
[    0.208109] ACPI: Dynamic OEM Table Load:
[    0.208144] ACPI: SSDT 0x00000000F4B30400 00015F (v01 PmRef  ApIst    00003000 INTL 20130117)
[    0.210074] ACPI: Dynamic OEM Table Load:
[    0.210108] ACPI: SSDT 0x00000000F4AEE180 00008D (v01 PmRef  ApCst    00003000 INTL 20130117)
[    0.213968] ACPI: Interpreter enabled
[    0.213992] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20150410/hwxface-580)
[    0.214007] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20150410/hwxface-580)
[    0.214019] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S3_] (20150410/hwxface-580)
[    0.214032] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S4_] (20150410/hwxface-580)
[    0.214044] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S5_] (20150410/hwxface-580)
[    0.214053] ACPI: (supports S0)
[    0.214058] ACPI: Using IOAPIC for interrupt routing
[    0.214120] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xe0000000-0xe3ffffff] (base 0xe0000000)
[    0.219818] [Firmware Info]: PCI: MMCONFIG at [mem 0xe0000000-0xe3ffffff] not reserved in ACPI motherboard resources
[    0.219826] PCI: not using MMCONFIG
[    0.219870] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.222647] ACPI: Power Resource [USBC] (on)
[    0.231897] ACPI: Power Resource [PLPE] (on)
[    0.241372] ACPI: Power Resource [CLK0] (on)
[    0.241527] ACPI: Power Resource [CLK1] (on)
[    0.241793] ACPI: Power Resource [P28X] (off)
[    0.241930] ACPI: Power Resource [P18X] (off)
[    0.244659] ACPI: Power Resource [TCPR] (off)
[    0.254443] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.254461] acpi PNP0A08:00: _OSC: OS supports [ASPM ClockPM Segments MSI]
[    0.254588] \_SB_.PCI0:_OSC invalid UUID
[    0.254594] _OSC request data:1 1e 0 
[    0.254608] acpi PNP0A08:00: _OSC failed (AE_ERROR); disabling ASPM
[    0.255003] acpi PNP0A08:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
[    0.255351] PCI host bridge to bus 0000:00
[    0.255362] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.255370] pci_bus 0000:00: root bus resource [io  0x0070-0x0077]
[    0.255377] pci_bus 0000:00: root bus resource [io  0x0000-0x006f window]
[    0.255384] pci_bus 0000:00: root bus resource [io  0x0078-0x0cf7 window]
[    0.255391] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
[    0.255399] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[    0.255405] pci_bus 0000:00: root bus resource [mem 0x000c0000-0x000dffff window]
[    0.255412] pci_bus 0000:00: root bus resource [mem 0x000e0000-0x000fffff window]
[    0.255420] pci_bus 0000:00: root bus resource [mem 0x90c00000-0x90ffffff window]
[    0.255427] pci_bus 0000:00: root bus resource [mem 0x7af00001-0x7ef00000 window]
[    0.255434] pci_bus 0000:00: root bus resource [mem 0x80000000-0x908ffffe window]
[    0.255440] pci_bus 0000:00: root bus resource [mem 0xfed40000-0xfed40fff window]
[    0.255460] pci 0000:00:00.0: [8086:0f00] type 00 class 0x060000
[    0.255714] pci 0000:00:02.0: [8086:0f31] type 00 class 0x030000
[    0.255739] pci 0000:00:02.0: reg 0x10: [mem 0x90000000-0x903fffff]
[    0.255760] pci 0000:00:02.0: reg 0x18: [mem 0x80000000-0x8fffffff pref]
[    0.255780] pci 0000:00:02.0: reg 0x20: [io  0x1000-0x1007]
[    0.256030] pci 0000:00:14.0: [8086:0f35] type 00 class 0x0c0330
[    0.256061] pci 0000:00:14.0: reg 0x10: [mem 0x90800000-0x9080ffff 64bit]
[    0.256148] pci 0000:00:14.0: PME# supported from D3hot D3cold
[    0.256367] pci 0000:00:1a.0: [8086:0f18] type 00 class 0x108000
[    0.256397] pci 0000:00:1a.0: reg 0x10: [mem 0x90700000-0x907fffff]
[    0.256415] pci 0000:00:1a.0: reg 0x14: [mem 0x90600000-0x906fffff]
[    0.256522] pci 0000:00:1a.0: PME# supported from D0 D3hot
[    0.256749] pci 0000:00:1f.0: [8086:0f1c] type 00 class 0x060100
[    0.257020] pci_bus 0000:00: on NUMA node 0
[    0.257781] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.257980] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.258177] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.258372] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.258567] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.258787] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.258998] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.259215] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.260193] gpiochip_find_base: found new base at 410
[    0.260336] gpiochip_add: registered GPIOs 410 to 511 on device: INT33FC:00
[    0.260349] byt_gpio INT33FC:00: disabling GPIO 0
[    0.260359] byt_gpio INT33FC:00: disabling GPIO 1
[    0.260369] byt_gpio INT33FC:00: disabling GPIO 2
[    0.260379] byt_gpio INT33FC:00: disabling GPIO 3
[    0.260388] byt_gpio INT33FC:00: disabling GPIO 4
[    0.260398] byt_gpio INT33FC:00: disabling GPIO 5
[    0.260407] byt_gpio INT33FC:00: disabling GPIO 6
[    0.260474] byt_gpio INT33FC:00: disabling GPIO 38
[    0.260489] byt_gpio INT33FC:00: disabling GPIO 42
[    0.260499] byt_gpio INT33FC:00: disabling GPIO 43
[    0.260509] byt_gpio INT33FC:00: disabling GPIO 44
[    0.260518] byt_gpio INT33FC:00: disabling GPIO 45
[    0.260528] byt_gpio INT33FC:00: disabling GPIO 46
[    0.260537] byt_gpio INT33FC:00: disabling GPIO 47
[    0.260547] byt_gpio INT33FC:00: disabling GPIO 48
[    0.260557] byt_gpio INT33FC:00: disabling GPIO 49
[    0.260566] byt_gpio INT33FC:00: disabling GPIO 50
[    0.260576] byt_gpio INT33FC:00: disabling GPIO 51
[    0.260585] byt_gpio INT33FC:00: disabling GPIO 52
[    0.260595] byt_gpio INT33FC:00: disabling GPIO 53
[    0.260605] byt_gpio INT33FC:00: disabling GPIO 54
[    0.260614] byt_gpio INT33FC:00: disabling GPIO 55
[    0.260624] byt_gpio INT33FC:00: disabling GPIO 56
[    0.260635] byt_gpio INT33FC:00: disabling GPIO 58
[    0.260645] byt_gpio INT33FC:00: disabling GPIO 59
[    0.260654] byt_gpio INT33FC:00: disabling GPIO 60
[    0.260738] byt_gpio INT33FC:00: disabling GPIO 94
[    0.260749] byt_gpio INT33FC:00: disabling GPIO 95
[    0.260762] byt_gpio INT33FC:00: disabling GPIO 98
[    0.260773] byt_gpio INT33FC:00: disabling GPIO 100
[    0.260783] byt_gpio INT33FC:00: disabling GPIO 101
[    0.261427] gpiochip_find_base: found new base at 382
[    0.261515] gpiochip_add: registered GPIOs 382 to 409 on device: INT33FC:01
[    0.261531] byt_gpio INT33FC:01: disabling GPIO 3
[    0.261541] byt_gpio INT33FC:01: disabling GPIO 4
[    0.261550] byt_gpio INT33FC:01: disabling GPIO 5
[    0.261559] byt_gpio INT33FC:01: disabling GPIO 6
[    0.261568] byt_gpio INT33FC:01: disabling GPIO 7
[    0.261578] byt_gpio INT33FC:01: disabling GPIO 8
[    0.261587] byt_gpio INT33FC:01: disabling GPIO 9
[    0.261596] byt_gpio INT33FC:01: disabling GPIO 10
[    0.261605] byt_gpio INT33FC:01: disabling GPIO 11
[    0.261615] byt_gpio INT33FC:01: disabling GPIO 12
[    0.261624] byt_gpio INT33FC:01: disabling GPIO 13
[    0.261633] byt_gpio INT33FC:01: disabling GPIO 14
[    0.261642] byt_gpio INT33FC:01: disabling GPIO 15
[    0.261652] byt_gpio INT33FC:01: disabling GPIO 16
[    0.261661] byt_gpio INT33FC:01: disabling GPIO 17
[    0.261670] byt_gpio INT33FC:01: disabling GPIO 18
[    0.261680] byt_gpio INT33FC:01: disabling GPIO 19
[    0.261702] byt_gpio INT33FC:01: disabling GPIO 20
[    0.261712] byt_gpio INT33FC:01: disabling GPIO 21
[    0.261721] byt_gpio INT33FC:01: disabling GPIO 22
[    0.261731] byt_gpio INT33FC:01: disabling GPIO 23
[    0.261740] byt_gpio INT33FC:01: disabling GPIO 24
[    0.261749] byt_gpio INT33FC:01: disabling GPIO 25
[    0.261759] byt_gpio INT33FC:01: disabling GPIO 26
[    0.261768] byt_gpio INT33FC:01: disabling GPIO 27
[    0.262095] gpiochip_find_base: found new base at 338
[    0.262257] gpiochip_add: registered GPIOs 338 to 381 on device: INT33FC:02
[    0.262272] byt_gpio INT33FC:02: disabling GPIO 1
[    0.262283] byt_gpio INT33FC:02: disabling GPIO 2
[    0.262296] byt_gpio INT33FC:02: disabling GPIO 4
[    0.262308] byt_gpio INT33FC:02: disabling GPIO 6
[    0.262321] byt_gpio INT33FC:02: disabling GPIO 8
[    0.262332] byt_gpio INT33FC:02: disabling GPIO 9
[    0.262342] byt_gpio INT33FC:02: disabling GPIO 10
[    0.262364] byt_gpio INT33FC:02: disabling GPIO 16
[    0.262377] byt_gpio INT33FC:02: disabling GPIO 18
[    0.262390] byt_gpio INT33FC:02: disabling GPIO 20
[    0.262401] byt_gpio INT33FC:02: disabling GPIO 21
[    0.262411] byt_gpio INT33FC:02: disabling GPIO 22
[    0.262422] byt_gpio INT33FC:02: disabling GPIO 23
[    0.262432] byt_gpio INT33FC:02: disabling GPIO 24
[    0.262443] byt_gpio INT33FC:02: disabling GPIO 25
[    0.262453] byt_gpio INT33FC:02: disabling GPIO 26
[    0.262464] byt_gpio INT33FC:02: disabling GPIO 27
[    0.262474] byt_gpio INT33FC:02: disabling GPIO 28
[    0.262484] byt_gpio INT33FC:02: disabling GPIO 29
[    0.262495] byt_gpio INT33FC:02: disabling GPIO 30
[    0.273988] vgaarb: setting as boot device: PCI:0000:00:02.0
[    0.273997] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
[    0.274003] vgaarb: loaded
[    0.274008] vgaarb: bridge control possible 0000:00:02.0
[    0.274872] SCSI subsystem initialized
[    0.275012] libata version 3.00 loaded.
[    0.275396] spi_master spi32766: raised num_chipselect to 20 for WM510205:00
[    0.275796] ACPI: bus type USB registered
[    0.275887] usbcore: registered new interface driver usbfs
[    0.275925] usbcore: registered new interface driver hub
[    0.275992] usbcore: registered new device driver usb
[    0.276648] Advanced Linux Sound Architecture Driver Initialized.
[    0.276660] PCI: Using ACPI for IRQ routing
[    0.276666] PCI: pci_cache_line_size set to 64 bytes
[    0.276696] Expanded resource reserved due to conflict with PCI Bus 0000:00
[    0.276704] e820: reserve RAM buffer [mem 0x0008f000-0x0008ffff]
[    0.276709] e820: reserve RAM buffer [mem 0x0009e000-0x0009ffff]
[    0.276715] e820: reserve RAM buffer [mem 0x782d6000-0x7bffffff]
[    0.276721] e820: reserve RAM buffer [mem 0x7950f000-0x7bffffff]
[    0.276726] e820: reserve RAM buffer [mem 0x7a000000-0x7bffffff]
[    0.276731] e820: reserve RAM buffer [mem 0x7ad00000-0x7bffffff]
[    0.277119] NetLabel: Initializing
[    0.277124] NetLabel:  domain hash size = 128
[    0.277127] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.277161] NetLabel:  unlabeled traffic allowed by default
[    0.277508] Switched to clocksource refined-jiffies
[    0.306242] pnp: PnP ACPI init
[    0.306428] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active)
[    0.306630] system 00:01: [io  0x0680-0x069f] has been reserved
[    0.306639] system 00:01: [io  0x0400-0x047f] has been reserved
[    0.306647] system 00:01: [io  0x0500-0x05fe] has been reserved
[    0.306655] system 00:01: [io  0x0600-0x061f] has been reserved
[    0.306663] system 00:01: [io  0x164e-0x164f] has been reserved
[    0.306675] system 00:01: Plug and Play ACPI device, IDs PNP0c02 (active)
[    0.306975] pnp 00:02: Plug and Play ACPI device, IDs PNP0501 (active)
[    0.309779] pnp: PnP ACPI: found 3 devices
[    0.317262] pci_bus 0000:00: resource 4 [io  0x0070-0x0077]
[    0.317271] pci_bus 0000:00: resource 5 [io  0x0000-0x006f window]
[    0.317279] pci_bus 0000:00: resource 6 [io  0x0078-0x0cf7 window]
[    0.317286] pci_bus 0000:00: resource 7 [io  0x0d00-0xffff window]
[    0.317294] pci_bus 0000:00: resource 8 [mem 0x000a0000-0x000bffff window]
[    0.317301] pci_bus 0000:00: resource 9 [mem 0x000c0000-0x000dffff window]
[    0.317308] pci_bus 0000:00: resource 10 [mem 0x000e0000-0x000fffff window]
[    0.317315] pci_bus 0000:00: resource 11 [mem 0x90c00000-0x90ffffff window]
[    0.317322] pci_bus 0000:00: resource 12 [mem 0x7af00001-0x7ef00000 window]
[    0.317329] pci_bus 0000:00: resource 13 [mem 0x80000000-0x908ffffe window]
[    0.317351] pci_bus 0000:00: resource 14 [mem 0xfed40000-0xfed40fff window]
[    0.317439] NET: Registered protocol family 2
[    0.317932] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.317986] TCP bind hash table entries: 8192 (order: 5, 163840 bytes)
[    0.318093] TCP: Hash tables configured (established 8192 bind 8192)
[    0.318140] UDP hash table entries: 512 (order: 2, 24576 bytes)
[    0.318164] UDP-Lite hash table entries: 512 (order: 2, 24576 bytes)
[    0.318299] NET: Registered protocol family 1
[    0.318340] pci 0000:00:02.0: Video device with shadowed ROM
[    0.318744] PCI: CLS 0 bytes, default 64
[    0.318911] Unpacking initramfs...
[    1.077194] Freeing initrd memory: 17084K (f634f000 - f73fe000)
[    1.077783] microcode: CPU0 sig=0x30678, pf=0x2, revision=0x829
[    1.077804] microcode: CPU1 sig=0x30678, pf=0x2, revision=0x829
[    1.077852] microcode: CPU2 sig=0x30678, pf=0x2, revision=0x829
[    1.077874] microcode: CPU3 sig=0x30678, pf=0x2, revision=0x829
[    1.078041] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[    1.078952] apm: BIOS version 115.85 Flags 0x616f (Driver version 1.16ac)
[    1.078958] apm: disabled - APM is not SMP safe.
[    1.079192] simple-framebuffer simple-framebuffer.0: framebuffer at 0x80000000, 0x8ca000 bytes, mapped to 0xf8c00000
[    1.079201] simple-framebuffer simple-framebuffer.0: format=a8r8g8b8, mode=1200x1920x32, linelength=4800
[    1.113742] Console: switching to colour frame buffer device 150x120
[    1.146825] simple-framebuffer simple-framebuffer.0: fb0: simplefb registered!
[    1.154380] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    1.154419] Initialise system trusted keyring
[    1.154468] audit: initializing netlink subsys (enabled)
[    1.154513] audit: type=2000 audit(1431532087.009:1): initialized
[    1.155150] HugeTLB registered 4 MB page size, pre-allocated 0 pages
[    1.159950] zpool: loaded
[    1.159957] zbud: loaded
[    1.160246] VFS: Disk quotas dquot_6.6.0
[    1.160358] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.161488] Key type big_key registered
[    1.161497] SELinux:  Registering netfilter hooks
[    1.163470] alg: No test for stdrng (krng)
[    1.163494] NET: Registered protocol family 38
[    1.163512] Key type asymmetric registered
[    1.163519] Asymmetric key parser 'x509' registered
[    1.163575] bounce: pool size: 64 pages
[    1.163686] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    1.163790] io scheduler noop registered
[    1.163798] io scheduler deadline registered
[    1.163901] io scheduler cfq registered (default)
[    1.164328] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    1.164396] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    1.164500] intel_idle: MWAIT substates: 0x33000020
[    1.164506] intel_idle: v0.4 model 0x37
[    1.164510] intel_idle: lapic_timer_reliable_states 0xffffffff
[    1.165513] ACPI: AC Adapter [ADP1] (on-line)
[    1.165983] input: Lid Switch as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input0
[    1.166098] ACPI: Lid Switch [LID0]
[    1.170818] [Firmware Bug]: No valid trip found
[    1.170947] GHES: HEST is not enabled!
[    1.171139] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    1.191505] 00:02: ttyS0 at I/O 0x3f8 (irq = 203, base_baud = 115200) is a 16550A
[    1.192760] hpet: number irqs doesn't agree with number of timers
[    1.192941] Non-volatile memory driver v1.3
[    1.193054] Linux agpgart interface v0.103
[    1.193135] [drm] Initialized drm 1.1.0 20060810
[    1.195181] libphy: Fixed MDIO Bus: probed
[    1.195582] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    1.195719] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 1
[    1.196137] xhci_hcd 0000:00:14.0: hcc params 0x200077c1 hci version 0x100 quirks 0x00009810
[    1.196151] xhci_hcd 0000:00:14.0: cache line size of 64 is not supported
[    1.196360] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.196368] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.196374] usb usb1: Product: xHCI Host Controller
[    1.196380] usb usb1: Manufacturer: Linux 4.1.0.26-rc3 xhci-hcd
[    1.196386] usb usb1: SerialNumber: 0000:00:14.0
[    1.196805] hub 1-0:1.0: USB hub found
[    1.196835] hub 1-0:1.0: 6 ports detected
[    1.198260] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    1.198404] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 2
[    1.198544] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[    1.198552] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.198559] usb usb2: Product: xHCI Host Controller
[    1.198565] usb usb2: Manufacturer: Linux 4.1.0.26-rc3 xhci-hcd
[    1.198570] usb usb2: SerialNumber: 0000:00:14.0
[    1.198960] hub 2-0:1.0: USB hub found
[    1.198986] hub 2-0:1.0: 1 port detected
[    1.199404] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.199421] ehci-pci: EHCI PCI platform driver
[    1.199460] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.199474] ohci-pci: OHCI PCI platform driver
[    1.199510] uhci_hcd: USB Universal Host Controller Interface driver
[    1.199672] usbcore: registered new interface driver usbserial
[    1.199700] usbcore: registered new interface driver usbserial_generic
[    1.199726] usbserial: USB Serial support registered for generic
[    1.199823] i8042: PNP: No PS/2 controller found. Probing ports directly.
[    2.243821] i8042: No controller found
[    2.244224] mousedev: PS/2 mouse device common for all mice
[    2.244799] ACPI Warning: Could not enable fixed event - RealTimeClock (4) (20150410/evxface-654)
[    2.245056] rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
[    2.245194] rtc_cmos: probe of 00:00 failed with error -22
[    2.245417] device-mapper: uevent: version 1.0.3
[    2.245644] device-mapper: ioctl: 4.31.0-ioctl (2015-3-12) initialised: dm-devel@redhat.com
[    2.245919] Intel P-state driver initializing.
[    2.246249] sdhci: Secure Digital Host Controller Interface driver
[    2.246254] sdhci: Copyright(c) Pierre Ossman
[    2.247433] sdhci-acpi 80860F14:00: No vmmc regulator found
[    2.247440] sdhci-acpi 80860F14:00: No vqmmc regulator found
[    2.252498] mmc0: SDHCI controller on ACPI [80860F14:00] using ADMA
[    2.253699] sdhci-acpi INT33BB:00: No vmmc regulator found
[    2.253707] sdhci-acpi INT33BB:00: No vqmmc regulator found
[    2.258851] mmc1: SDHCI controller on ACPI [INT33BB:00] using ADMA
[    2.258993] sdhci-acpi 80860F14:01: GPIO lookup for consumer 80860F14:01 cd
[    2.259001] sdhci-acpi 80860F14:01: using ACPI for GPIO lookup
[    2.259009] acpi 80860F14:01: GPIO: looking up 80860F14:01 cd-gpios
[    2.259017] acpi 80860F14:01: GPIO: looking up 80860F14:01 cd-gpio
[    2.259023] acpi 80860F14:01: GPIO: looking up 0 in _CRS
[    2.260168] sdhci-acpi 80860F14:01: No vmmc regulator found
[    2.260173] sdhci-acpi 80860F14:01: No vqmmc regulator found
[    2.265256] mmc2: SDHCI controller on ACPI [80860F14:01] using ADMA
[    2.265340] ioremap error for 0x78789000-0x7878a000, requested 0x2, got 0x0
[    2.265481] EFI Variables Facility v0.08 2004-May-17
[    2.276022] clocksource tsc: mask: 0xffffffffffffffff max_cycles: 0x1333333ae14, max_idle_ns: 440795264474 ns
[    2.280256] Switched to clocksource tsc
[    2.282466] hidraw: raw HID events driver (C) Jiri Kosina
[    2.282773] usbcore: registered new interface driver usbhid
[    2.282777] usbhid: USB HID core driver
[    2.283461] ip_tables: (C) 2000-2006 Netfilter Core Team
[    2.283493] audit: type=1325 audit(1431532087.948:2): table=filter family=2 entries=0
[    2.284228] Initializing XFRM netlink socket
[    2.284245] NET: Registered protocol family 17
[    2.284982] Using IPI No-Shortcut mode
[    2.285584] Loading compiled-in X.509 certificates
[    2.291502] Loaded X.509 cert 'Magrathea: Glacier signing key: 0fb0674c7be57650c400f99c36e767ef51a011ef'
[    2.291531] registered taskstats version 1
[    2.295924]   Magic number: 15:348:841
[    2.296022] hctosys: unable to open rtc device (rtc0)
[    2.296398] PM: Hibernation image not present or could not be loaded.
[    2.296426] ALSA device list:
[    2.296429]   No soundcards found.
[    2.297118] Freeing unused kernel memory: 796K (c0efc000 - c0fc3000)
[    2.297985] Write protecting the kernel text: 7416k
[    2.298422] Write protecting the kernel read-only data: 3072k
[    2.302976] systemd[1]: Failed to insert module 'ipv6'
[    2.340931] random: systemd urandom read with 0 bits of entropy available
[    2.342867] systemd[1]: systemd 219 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[    2.343311] systemd[1]: Detected architecture 'x86'.
[    2.343322] systemd[1]: Running in initial RAM disk.
[    2.343386] systemd[1]: Set hostname to <yoga.fyedot.greenzone>.
[    2.368850] mmc0: MAN_BKOPS_EN bit is not set
[    2.378642] mmc0: new HS200 MMC card at address 0001
[    2.379068] mmcblk0: mmc0:0001 MBG4GC 29.1 GiB 
[    2.379154] mmcblk0boot0: mmc0:0001 MBG4GC partition 1 4.00 MiB
[    2.379314] mmcblk0boot1: mmc0:0001 MBG4GC partition 2 4.00 MiB
[    2.379398] mmcblk0rpmb: mmc0:0001 MBG4GC partition 3 4.00 MiB
[    2.387297]  mmcblk0: p1 p2 p3 p4
[    2.413136] systemd[1]: Unit type .busname is not supported on this system.
[    2.426738] systemd[1]: Cannot add dependency job for unit systemd-journald-audit.socket, ignoring: Unit systemd-journald-audit.socket failed to load: No such file or directory.
[    2.427513] systemd[1]: Reached target Local File Systems.
[    2.427542] systemd[1]: Starting Local File Systems.
[    2.427593] systemd[1]: Reached target Timers.
[    2.427617] systemd[1]: Starting Timers.
[    2.427651] systemd[1]: Reached target Swap.
[    2.427675] systemd[1]: Starting Swap.
[    2.428424] systemd[1]: Created slice -.slice.
[    2.428451] systemd[1]: Starting -.slice.
[    2.428601] systemd[1]: Listening on Journal Socket.
[    2.428629] systemd[1]: Starting Journal Socket.
[    2.428715] systemd[1]: Listening on Journal Socket (/dev/log).
[    2.428741] systemd[1]: Starting Journal Socket (/dev/log).
[    2.428816] systemd[1]: Listening on udev Kernel Socket.
[    2.428841] systemd[1]: Starting udev Kernel Socket.
[    2.428945] systemd[1]: Listening on udev Control Socket.
[    2.428971] systemd[1]: Starting udev Control Socket.
[    2.429006] systemd[1]: Reached target Sockets.
[    2.429031] systemd[1]: Starting Sockets.
[    2.429237] systemd[1]: Created slice System Slice.
[    2.429265] systemd[1]: Starting System Slice.
[    2.429589] systemd[1]: Started Load Kernel Modules.
[    2.430630] systemd[1]: Starting Journal Service...
[    2.430889] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    2.430917] systemd[1]: Starting system-systemd\x2dfsck.slice.
[    2.431979] systemd[1]: Starting Apply Kernel Variables...
[    2.432108] systemd[1]: Started dracut ask for additional cmdline parameters.
[    2.433807] systemd[1]: Starting dracut cmdline hook...
[    2.437681] systemd[1]: Starting Setup Virtual Console...
[    2.439681] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[    2.439757] systemd[1]: Reached target Slices.
[    2.439792] systemd[1]: Starting Slices.
[    2.442692] systemd[1]: Started Apply Kernel Variables.
[    2.443698] audit: type=1305 audit(1431532088.109:3): audit_enabled=1 old=1 auid=4294967295 ses=4294967295 subj=kernel res=1
[    2.443735] audit: type=1130 audit(1431532088.109:4): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-sysctl comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    2.444129] systemd-journald[124]: Failed to set file attributes: Inappropriate ioctl for device
[    2.449881] systemd[1]: Started Create list of required static device nodes for the current kernel.
[    2.449950] audit: type=1130 audit(1431532088.115:5): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=kmod-static-nodes comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    2.451363] systemd[1]: Starting Create Static Device Nodes in /dev...
[    2.459247] systemd[1]: Started Create Static Device Nodes in /dev.
[    2.459356] audit: type=1130 audit(1431532088.124:6): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-tmpfiles-setup-dev comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    2.478482] mmc1: new ultra high speed DDR50 SDIO card at address 0001
[    2.514406] systemd[1]: Started Journal Service.
[    2.514546] audit: type=1130 audit(1431532088.179:7): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-journald comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    2.532913] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    2.620330] audit: type=1130 audit(1431532088.285:8): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=dracut-cmdline comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    2.628925] audit: type=1130 audit(1431532088.294:9): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-vconsole-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    2.682598] mmc2: new high speed SDHC card at address e624
[    2.682992] mmcblk1: mmc2:e624 SU32G 29.7 GiB 
[    2.690735]  mmcblk1: p1
[    2.700163] audit: type=1130 audit(1431532088.365:10): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=dracut-pre-udev comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    2.708888] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
[    2.708896] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.708901] usb 1-1: Product: USB2.0 Hub
[    2.709687] hub 1-1:1.0: USB hub found
[    2.709978] hub 1-1:1.0: 4 ports detected
[    2.981309] usb 1-1.2: new high-speed USB device number 3 using xhci_hcd
[    3.058714] usb 1-1.2: New USB device found, idVendor=05e3, idProduct=0608
[    3.058723] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.058727] usb 1-1.2: Product: USB2.0 Hub
[    3.059819] hub 1-1.2:1.0: USB hub found
[    3.060104] hub 1-1.2:1.0: 4 ports detected
[    3.121295] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: (null)
[    3.339159] usb 1-1.2.2: new low-speed USB device number 4 using xhci_hcd
[    3.423567] usb 1-1.2.2: New USB device found, idVendor=046d, idProduct=c517
[    3.423575] usb 1-1.2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.423580] usb 1-1.2.2: Product: USB Receiver
[    3.423584] usb 1-1.2.2: Manufacturer: Logitech
[    3.423823] usb 1-1.2.2: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[    3.423833] usb 1-1.2.2: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[    3.427160] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2:1.0/0003:046D:C517.0001/input/input1
[    3.480324] logitech 0003:046D:C517.0001: input,hidraw0: USB HID v1.10 Keyboard [Logitech USB Receiver] on usb-0000:00:14.0-1.2.2/input0
[    3.486378] logitech 0003:046D:C517.0002: fixing up Logitech keyboard report descriptor
[    3.487854] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2:1.1/0003:046D:C517.0002/input/input2
[    3.541723] logitech 0003:046D:C517.0002: input,hiddev0,hidraw1: USB HID v1.10 Mouse [Logitech USB Receiver] on usb-0000:00:14.0-1.2.2/input1
[    3.605231] usb 1-1.2.3: new high-speed USB device number 5 using xhci_hcd
[    3.672234] systemd-journald[124]: Received SIGTERM from PID 1 (systemd).
[    3.688771] usb 1-1.2.3: New USB device found, idVendor=0b95, idProduct=1790
[    3.688779] usb 1-1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.688784] usb 1-1.2.3: Product: AX88179
[    3.688788] usb 1-1.2.3: Manufacturer: ASIX Elec. Corp.
[    3.688792] usb 1-1.2.3: SerialNumber: 00000000000001
[    3.816937] SELinux: 32768 avtab hash slots, 105082 rules.
[    3.855149] SELinux: 32768 avtab hash slots, 105082 rules.
[    3.921230] SELinux:  8 users, 103 roles, 4989 types, 294 bools, 1 sens, 1024 cats
[    3.921239] SELinux:  83 classes, 105082 rules
[    3.932584] SELinux:  Permission audit_read in class capability2 not defined in policy.
[    3.932600] SELinux:  Class binder not defined in policy.
[    3.932604] SELinux: the above unknown classes and permissions will be allowed
[    3.932614] SELinux:  Completing initialization.
[    3.932616] SELinux:  Setting up existing superblocks.
[    3.966465] systemd[1]: Successfully loaded SELinux policy in 192.404ms.
[    4.007808] systemd[1]: Failed to insert module 'ipv6'
[    4.068842] systemd[1]: Relabelled /dev and /run in 50.979ms.
[    4.153514] systemd-sysv-generator[357]: Overwriting existing symlink /run/systemd/generator.late/network.service with real service
[    4.153655] systemd-sysv-generator[357]: Overwriting existing symlink /run/systemd/generator.late/livesys-late.service with real service
[    4.154373] systemd-sysv-generator[357]: Overwriting existing symlink /run/systemd/generator.late/netconsole.service with real service
[    4.154483] systemd-sysv-generator[357]: Overwriting existing symlink /run/systemd/generator.late/livesys.service with real service
[    4.495495] systemd-journald[392]: Failed to issue audit enable call: Permission denied
[    4.575841] EXT4-fs (mmcblk0p4): re-mounted. Opts: (null)
[    4.629720] RPC: Registered named UNIX socket transport module.
[    4.629728] RPC: Registered udp transport module.
[    4.629731] RPC: Registered tcp transport module.
[    4.629734] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    4.636350] systemd-journald[392]: Received request to flush runtime journal from PID 1
[    5.217623] rfkill_gpio LNV4752:00: GPIO lookup for consumer reset
[    5.217631] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
[    5.217638] acpi LNV4752:00: GPIO: looking up reset-gpios
[    5.217645] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 0 0 0
[    5.217725] no flags found for reset
[    5.217736] rfkill_gpio LNV4752:00: GPIO lookup for consumer shutdown
[    5.217740] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
[    5.217745] acpi LNV4752:00: GPIO: looking up shutdown-gpios
[    5.217751] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 1 0 0
[    5.217788] acpi LNV4752:00: GPIO: looking up shutdown-gpio
[    5.217794] acpi LNV4752:00: GPIO: looking up 0 in _CRS
[    5.217830] gpio-411 (reset): gpiod_request: status -16
[    5.217927] rfkill_gpio LNV4752:00: LNV4752:00 device registered.
[    5.246179] sst-acpi 80860F28:00: No matching ASoC machine driver found
[    5.264608] BUG: unable to handle kernel NULL pointer dereference at 00000020
[    5.264621] IP: [<f7df103f>] arizona_spi_probe+0x1f/0xec [arizona_spi]
[    5.264631] *pde = 00000000 
[    5.264636] Oops: 0000 [#1] SMP 
[    5.264641] Modules linked in: pcc_cpufreq(-) arizona_spi(+) snd_soc_sst_acpi(+) pwm_lpss_platform acpi_cpufreq(-) rfkill_gpio arizona_i2c mei pwm_lpss lpc_ich i2c_designware_core rfkill sunrpc
[    5.264665] CPU: 3 PID: 444 Comm: systemd-udevd Not tainted 4.1.0.26-rc3 #127
[    5.264669] Hardware name: LENOVO 60072/INVALID, BIOS 02WT18WW 08/01/2014
[    5.264674] task: f6fbe420 ti: f280e000 task.ti: f280e000
[    5.264678] EIP: 0060:[<f7df103f>] EFLAGS: 00010246 CPU: 3
[    5.264683] EIP is at arizona_spi_probe+0x1f/0xec [arizona_spi]
[    5.264687] EAX: 00000000 EBX: f4bbb800 ECX: f7df3010 EDX: f7df20c8
[    5.264691] ESI: 00000000 EDI: f7df3000 EBP: f280fce8 ESP: f280fccc
[    5.264694]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[    5.264698] CR0: 8005003b CR2: 00000020 CR3: 3284a000 CR4: 001007d0
[    5.264701] Stack:
[    5.264704]  f280007b c074007b f4bb00d8 f4bb00e0 00000000 f4bbb800 f7df3000 f280fcfc
[    5.264715]  c091b3c4 f4bbb800 f7df3010 00000000 f280fd30 c08a13fa f7df3060 f7df3010
[    5.264727]  f280fd1c c0746527 5c7d87d3 f4bbb834 0000000f f4bbb834 f4bbb800 f7df3010
[    5.264737] Call Trace:
[    5.264748]  [<c074007b>] ? efifb_probe+0x7b/0x220
[    5.264757]  [<c091b3c4>] spi_drv_probe+0x34/0x60
[    5.264764]  [<c08a13fa>] driver_probe_device+0x1ba/0x400
[    5.264770]  [<c0746527>] ? acpi_driver_match_device+0x36/0x3f
[    5.264776]  [<c08a16f1>] __driver_attach+0x71/0x80
[    5.264781]  [<c08a1680>] ? __device_attach+0x40/0x40
[    5.264786]  [<c089f6b7>] bus_for_each_dev+0x57/0xa0
[    5.264792]  [<c08a0dde>] driver_attach+0x1e/0x20
[    5.264796]  [<c08a1680>] ? __device_attach+0x40/0x40
[    5.264801]  [<c08a0a27>] bus_add_driver+0x157/0x230
[    5.264807]  [<f7df6000>] ? 0xf7df6000
[    5.264811]  [<f7df6000>] ? 0xf7df6000
[    5.264816]  [<c08a1df9>] driver_register+0x59/0xe0
[    5.264823]  [<c06d3760>] ? kvasprintf+0x40/0x50
[    5.264828]  [<c091b341>] spi_register_driver+0x41/0x50
[    5.264835]  [<f7df600d>] arizona_spi_driver_init+0xd/0x1000 [arizona_spi]
[    5.264841]  [<c0400472>] do_one_initcall+0xc2/0x1f0
[    5.264845]  [<f7df6000>] ? 0xf7df6000
[    5.264852]  [<c052b2e3>] ? free_pages_prepare+0x1c3/0x360
[    5.264859]  [<c0569c85>] ? kmem_cache_alloc_trace+0x175/0x1e0
[    5.264865]  [<c0b2e24e>] ? do_init_module+0x24/0x1ae
[    5.264870]  [<c0b2e27d>] do_init_module+0x53/0x1ae
[    5.264877]  [<c04c4e54>] load_module+0x1034/0x16b0
[    5.264884]  [<c04c1e69>] ? copy_module_from_fd.isra.48+0x109/0x1a0
[    5.264891]  [<c04c56bd>] SyS_finit_module+0x8d/0xd0
[    5.264897]  [<c053f053>] ? vm_mmap_pgoff+0x93/0xb0
[    5.264905]  [<c0b3b20f>] sysenter_do_call+0x12/0x12
[    5.264908] Code: 8d b6 00 00 00 00 8d bf 00 00 00 00 55 89 e5 57 56 53 83 ec 10 3e 8d 74 26 00 89 c3 e8 6b b2 b2 c8 89 c6 8b 83 70 01 00 00 85 c0 <8b> 46 20 74 24 89 44 24 08 c7 44 24 04 24 20 df f7 89 1c 24 e8
[    5.264978] EIP: [<f7df103f>] arizona_spi_probe+0x1f/0xec [arizona_spi] SS:ESP 0068:f280fccc
[    5.264985] CR2: 0000000000000020
[    5.264991] ---[ end trace 036db66979862189 ]---
[    5.374431] intel_sst_acpi 80860F28:00: No matching machine driver found
[    5.436927] random: nonblocking pool is initialized
[    5.665524] mei_txe 0000:00:1a.0: NFC MEI VERSION: IVN 0x1 Vendor ID 0x1 Type 0x1
[    5.713785] ACPI: Battery Slot [BATC] (battery present)
[    5.714016] soc_button_array INTCFD9:00: GPIO lookup for consumer soc_button_array
[    5.714038] soc_button_array INTCFD9:00: using ACPI for GPIO lookup
[    5.714045] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpios
[    5.714051] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpio
[    5.714056] acpi INTCFD9:00: GPIO: looking up 2 in _CRS
[    5.714154] no flags found for soc_button_array
[    5.714165] soc_button_array INTCFD9:00: GPIO lookup for consumer soc_button_array
[    5.714169] soc_button_array INTCFD9:00: using ACPI for GPIO lookup
[    5.714174] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpios
[    5.714180] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpio
[    5.714184] acpi INTCFD9:00: GPIO: looking up 3 in _CRS
[    5.714225] no flags found for soc_button_array
[    5.714322] soc_button_array INTCFD9:00: GPIO lookup for consumer soc_button_array
[    5.714328] soc_button_array INTCFD9:00: using ACPI for GPIO lookup
[    5.714333] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpios
[    5.714338] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpio
[    5.714343] acpi INTCFD9:00: GPIO: looking up 0 in _CRS
[    5.714385] no flags found for soc_button_array
[    5.714394] soc_button_array INTCFD9:00: GPIO lookup for consumer soc_button_array
[    5.714399] soc_button_array INTCFD9:00: using ACPI for GPIO lookup
[    5.714404] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpios
[    5.714409] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpio
[    5.714413] acpi INTCFD9:00: GPIO: looking up 1 in _CRS
[    5.714453] no flags found for soc_button_array
[    5.714462] soc_button_array INTCFD9:00: GPIO lookup for consumer soc_button_array
[    5.714466] soc_button_array INTCFD9:00: using ACPI for GPIO lookup
[    5.714471] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpios
[    5.714476] acpi INTCFD9:00: GPIO: looking up soc_button_array-gpio
[    5.714481] acpi INTCFD9:00: GPIO: looking up 4 in _CRS
[    5.714516] soc_button_array INTCFD9:00: using lookup tables for GPIO lookup
[    5.714522] soc_button_array INTCFD9:00: lookup for GPIO soc_button_array failed
[    5.752185] i2c i2c-4: Failed to register i2c client MAGN0001:00 at 0x1d (-16)
[    5.752194] i2c i2c-4: failed to add I2C device MAGN0001:00 from ACPI
[    5.753526] intel_soc_pmic_i2c i2c-INT33FD:00: GPIO lookup for consumer intel_soc_pmic
[    5.753535] intel_soc_pmic_i2c i2c-INT33FD:00: using ACPI for GPIO lookup
[    5.753542] acpi INT33FD:00: GPIO: looking up intel_soc_pmic-gpios
[    5.753548] acpi INT33FD:00: GPIO: looking up intel_soc_pmic-gpio
[    5.753553] acpi INT33FD:00: GPIO: looking up 0 in _CRS
[    5.756790] intel_soc_pmic_i2c i2c-INT33FD:00: using lookup tables for GPIO lookup
[    5.756801] intel_soc_pmic_i2c i2c-INT33FD:00: lookup for GPIO intel_soc_pmic failed
[    5.768906] dw_dmac INTL9C60:00: DesignWare DMA Controller, 8 channels
[    5.773372] dw_dmac INTL9C60:01: DesignWare DMA Controller, 8 channels
[    5.919998] input: PC Speaker as /devices/platform/pcspkr/input/input3
[    6.183259] iTCO_vendor_support: vendor-support=0
[    6.185711] alg: No test for crc32 (crc32-pclmul)
[    6.277113] cfg80211: Calling CRDA to update world regulatory domain
[    6.284864] input: gpio-keys as /devices/platform/gpio-keys.0.auto/input/input4
[    6.285213] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.11
[    6.285375] iTCO_wdt: Found a Bay Trail SoC TCO device (Version=3, TCOBASE=0x0460)
[    6.301552] input: gpio-keys as /devices/platform/gpio-keys.1.auto/input/input5
[    6.302140] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
[    6.378561] Adding 2097148k swap on /dev/mmcblk0p3.  Priority:-1 extents:1 across:2097148k SSFS
[    6.411082] intel_rapl: Found RAPL domain package
[    6.411085] intel_rapl: Found RAPL domain core
[    6.545117] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    6.567254] cfg80211: World regulatory domain updated:
[    6.567259] cfg80211:  DFS Master region: unset
[    6.567259] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[    6.567264] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[    6.567266] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[    6.567268] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[    6.567272] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[    6.567275] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[    6.567277] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[    6.567279] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[    6.567282] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[    6.690449] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    6.756534] brcmfmac: brcmf_sdio_drivestrengthinit: No SDIO Drive strength init done for chip 4324 rev 5 pmurev 17
[    6.757005] usbcore: registered new interface driver brcmfmac
[    6.833843] input: SYNA0001:00 2ABB:8101 as /devices/platform/80860F41:05/i2c-5/i2c-SYNA0001:00/0018:2ABB:8101.0003/input/input6
[    6.847205] hid-multitouch 0018:2ABB:8101.0003: input,hidraw2: <UNKNOWN> HID v1.00 Device [SYNA0001:00 2ABB:8101] on 
[    6.923702] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Jul 17 2013 07:36:07 version 6.10.197.71 (r412987) FWID 01-882d2634
[    6.945256] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
[    7.010579] cfg80211: Calling CRDA for country: DE
[    7.030780] audit_printk_skb: 177 callbacks suppressed
[    7.030783] audit: type=1130 audit(1431532092.694:68): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-rfkill@rfkill1 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    7.061644] cfg80211: Regulatory domain changed to country: DE
[    7.061649] cfg80211:  DFS Master region: ETSI
[    7.061649] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[    7.061654] cfg80211:   (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[    7.061659] cfg80211:   (5150000 KHz - 5250000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[    7.061663] cfg80211:   (5250000 KHz - 5350000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[    7.061667] cfg80211:   (5470000 KHz - 5725000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s)
[    7.061670] cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
[    7.461730] ax88179_178a 1-1.2.3:1.0 eth0: register 'ax88179_178a' at usb-0000:00:14.0-1.2.3, ASIX AX88179 USB 3.0 Gigabit Ethernet, 00:fe:c8:f7:bc:d9
[    7.461781] usbcore: registered new interface driver ax88179_178a
[    7.475680] ax88179_178a 1-1.2.3:1.0 enp0s20u1u2u3: renamed from eth0
[  184.793770] audit: type=1130 audit(1431532270.404:69): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-udev-settle comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
[  184.863823] audit: type=1130 audit(1431532270.474:70): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=dmraid-activation comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  184.863879] audit: type=1131 audit(1431532270.474:71): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=dmraid-activation comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  184.902080] audit: type=1130 audit(1431532270.512:72): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=plymouth-read-write comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  184.902138] audit: type=1131 audit(1431532270.512:73): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=plymouth-read-write comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  185.582224] audit: type=1130 audit(1431532271.192:74): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-tmpfiles-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  185.598090] audit: type=1305 audit(1431532271.208:75): auid=4294967295 ses=4294967295 subj=system_u:system_r:auditctl_t:s0 op="add_rule" key=(null) list=1 res=1
[  185.601953] audit: type=1130 audit(1431532271.212:76): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=auditd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  185.614988] audit: type=1305 audit(1431532271.225:77): audit_enabled=1 old=1 auid=4294967295 ses=4294967295 subj=system_u:system_r:auditd_t:s0 res=1
[  187.620290] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[  188.366456] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
[  188.366466] brcmfmac: brcmf_add_if: ignore IF event
[  191.397773] ax88179_178a 1-1.2.3:1.0 enp0s20u1u2u3: ax88179 - Link status is: 1

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [WM5102/ARIZONA] spi driver needs to support ACPI
  2015-05-15  9:16 [WM5102/ARIZONA] spi driver needs to support ACPI Christian Hartmann
@ 2015-05-18 16:29 ` Pierre-Louis Bossart
  2015-05-19  9:04   ` Christian Hartmann
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre-Louis Bossart @ 2015-05-18 16:29 UTC (permalink / raw)
  To: Christian Hartmann, alsa-devel

On 5/15/15 4:16 AM, Christian Hartmann wrote:
> Hi list,
>
>
> I need ACPI support for the arizona-core / arizona-spi driver for the
> ACPI ID WM5102.
> This audio codec is build into the Lenovo Yoga 851F. This device is a
> 32Bit (UEFI) system
>
> http://support.lenovo.com/de/de/products/tablets/yoga-series/yoga-tablet-2-851
>
>
> I have tested with vanilla kernels from kernel.org 3.19.y ,4.0.y and
> master (from torvalds) currently its 4.1.0-rc3. As distribution I am
> working with Fedora / Fedlet was the initial install image.
>
> With all vanilla kernels I got at first an error message from spi32766:
>
> [    0.296297] pxa2xx-spi 80860F0E:00: cs1 >= max 1
> [    0.296311] spi_master spi32766: failed to add SPI device
> WM510205:00 from ACPI
>
> so I have at first patched as suggested by broonie the arizona-core
>
> commit 48203a0fede057d6a8c5f6872c53326395350f45
> Author: somebody anybody <somebody@foobar.com>
> Date:   Mon May 11 13:35:43 2015 +0200
>
>      spi-pxa2xx : raise chipselect
>
>      Signed-off-by: somebody anybody <somebody@foobar.com>
>
> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
> index e3223ac..9c919ea 100644
> --- a/drivers/spi/spi-pxa2xx.c
> +++ b/drivers/spi/spi-pxa2xx.c
> @@ -1279,7 +1279,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
>          if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0, &devid))
>                  ssp->port_id = devid;
>
> -       pdata->num_chipselect = 1;
> +       pdata->num_chipselect = 20;
>          pdata->enable_dma = true;
>
>          return pdata;
>
> This leds the spi master do the further ACPI configuration and inital
> setup for the arizona-spi device, but adding the ACPI ID to it
> does not work yet as expected:
>
> The current last patchset on top of master is
>
>
> Author: somebody anybody <somebody@foobar.com>
> Date:   Wed May 13 11:36:25 2015 +0200
>
>      arizona : added ACPI id of wm5102 to SPI driver, too
>
>      Signed-off-by: somebody anybody <somebody@foobar.com>
>
> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
> index 1e845f6..c19a4c1 100644
> --- a/drivers/mfd/arizona-spi.c
> +++ b/drivers/mfd/arizona-spi.c
> @@ -17,6 +17,7 @@
>   #include <linux/regulator/consumer.h>
>   #include <linux/slab.h>
>   #include <linux/spi/spi.h>
> +#include <linux/acpi.h>
>   #include <linux/of.h>
>
>   #include <linux/mfd/arizona/core.h>
> @@ -82,6 +83,15 @@ static int arizona_spi_remove(struct spi_device *spi)
>          return 0;
>   }
>
> +#ifdef CONFIG_ACPI
> +static struct acpi_device_id wm5102_acpi_match[] = {
> +               { "WM5102", 0},
> +               { "WM510205", 0},
> +               { },
> +};
> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
> +#endif
> +
>   static const struct spi_device_id arizona_spi_ids[] = {
>          { "wm5102", WM5102 },
>          { "wm5110", WM5110 },
> @@ -96,6 +106,9 @@ static struct spi_driver arizona_spi_driver = {
>                  .owner  = THIS_MODULE,
>                  .pm     = &arizona_pm_ops,
>                  .of_match_table = of_match_ptr(arizona_of_match),
> +#ifdef CONFIG_ACPI
> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
> +#endif
>          },
>          .probe          = arizona_spi_probe,
>          .remove         = arizona_spi_remove,
>
>
>
>
> commit 268e21d29c942205e40f749c6d71c77839dc67da
> Author: somebody anybody <somebody@foobar.com>
> Date:   Wed May 13 11:36:04 2015 +0200
>
>      arizona : added ACPI id of wm5102 to i2c driver
>
>      Signed-off-by: somebody anybody <somebody@foobar.com>
>
> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
> index ff782a5..45ece1b 100644
> --- a/drivers/mfd/arizona-i2c.c
> +++ b/drivers/mfd/arizona-i2c.c
> @@ -18,6 +18,7 @@
>   #include <linux/regulator/consumer.h>
>   #include <linux/slab.h>
>   #include <linux/of.h>
> +#include <linux/acpi.h>
>
>   #include <linux/mfd/arizona/core.h>
>
> @@ -85,6 +86,15 @@ static int arizona_i2c_remove(struct i2c_client *i2c)
>          return 0;
>   }
>
> +#ifdef CONFIG_ACPI
> +static struct acpi_device_id wm5102_acpi_match[] = {
> +               { "WM5102", 0},
> +               { "WM510205", 0},
> +               { },

Those IDs don't really look like ACPI ones? Isn't there a rule that the 
_HID is represented by a 4-letter vendor ID followed by part ID? see 
http://www.uefi.org/PNP_ACPI_Registry


> +};
> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
> +#endif
> +
>   static const struct i2c_device_id arizona_i2c_id[] = {
>          { "wm5102", WM5102 },
>          { "wm5110", WM5110 },
> @@ -100,6 +110,9 @@ static struct i2c_driver arizona_i2c_driver = {
>                  .owner  = THIS_MODULE,
>                  .pm     = &arizona_pm_ops,
>                  .of_match_table = of_match_ptr(arizona_of_match),
> +#ifdef CONFIG_ACPI
> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
> +#endif
>          },
>          .probe          = arizona_i2c_probe,
>          .remove         = arizona_i2c_remove,
>
>
>
> with these two patches the local master branch compiles fine, but at
> initialzing the arizona-spi driver gots a NULL pointer exception.
>
> I attach the whole dmesg of 4.1.0-rc3 (build 4.1.0.24-rc3).
>
> I need some assistance or hints to the right direction, I am looking
> myself and I also try what I can, but I think it would be easy peasy
> with some experts like here on this list :)
>
>
> PS: the message : spi_master spi32766: raised num_chipselect to 20 for
> WM510205:00
>
> is a dev_err() line added to the function static acpi_status
> acpi_spi_add_device(), there I had raised the num_chipselect first
> (that was wrong, the raise is now done as in the first patch above.
> this is only a debug message and will be removed soon)
>
>
> PPS: for me it seems that there is a missing 'link' from WM5102 to the
> sst-acpi 80860F28:00 device, which complaints NOW / the first time
> with the three patches applied on top on master.... will have a look
> into it.
>
> I hope I got this device working with some more help from you.
>
> cheers
> chris
>
>
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [WM5102/ARIZONA] spi driver needs to support ACPI
  2015-05-18 16:29 ` Pierre-Louis Bossart
@ 2015-05-19  9:04   ` Christian Hartmann
  2015-05-19 13:39     ` Christian Hartmann
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Hartmann @ 2015-05-19  9:04 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: alsa-devel

Hi,

so the ACPI id string, which I want to add to arizona-spi.c should be

WM510205 ??

I have changed the ACPI string to

{"WM510205", WM5102},

now and give it a try.

cheers
chris

2015-05-18 18:29 GMT+02:00 Pierre-Louis Bossart
<pierre-louis.bossart@linux.intel.com>:
> On 5/15/15 4:16 AM, Christian Hartmann wrote:
>>
>> Hi list,
>>
>>
>> I need ACPI support for the arizona-core / arizona-spi driver for the
>> ACPI ID WM5102.
>> This audio codec is build into the Lenovo Yoga 851F. This device is a
>> 32Bit (UEFI) system
>>
>>
>> http://support.lenovo.com/de/de/products/tablets/yoga-series/yoga-tablet-2-851
>>
>>
>> I have tested with vanilla kernels from kernel.org 3.19.y ,4.0.y and
>> master (from torvalds) currently its 4.1.0-rc3. As distribution I am
>> working with Fedora / Fedlet was the initial install image.
>>
>> With all vanilla kernels I got at first an error message from spi32766:
>>
>> [ 0.296297] pxa2xx-spi 80860F0E:00: cs1 >= max 1
>> [ 0.296311] spi_master spi32766: failed to add SPI device
>> WM510205:00 from ACPI
>>
>> so I have at first patched as suggested by broonie the arizona-core
>>
>> commit 48203a0fede057d6a8c5f6872c53326395350f45
>> Author: somebody anybody <somebody@foobar.com>
>> Date:   Mon May 11 13:35:43 2015 +0200
>>
>>      spi-pxa2xx : raise chipselect
>>
>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>
>> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
>> index e3223ac..9c919ea 100644
>> --- a/drivers/spi/spi-pxa2xx.c
>> +++ b/drivers/spi/spi-pxa2xx.c
>> @@ -1279,7 +1279,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device
>> *pdev)
>>          if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0,
>> &devid))
>>                  ssp->port_id = devid;
>>
>> -       pdata->num_chipselect = 1;
>> +       pdata->num_chipselect = 20;
>>          pdata->enable_dma = true;
>>
>>          return pdata;
>>
>> This leds the spi master do the further ACPI configuration and inital
>> setup for the arizona-spi device, but adding the ACPI ID to it
>> does not work yet as expected:
>>
>> The current last patchset on top of master is
>>
>>
>> Author: somebody anybody <somebody@foobar.com>
>> Date:   Wed May 13 11:36:25 2015 +0200
>>
>>      arizona : added ACPI id of wm5102 to SPI driver, too
>>
>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>
>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>> index 1e845f6..c19a4c1 100644
>> --- a/drivers/mfd/arizona-spi.c
>> +++ b/drivers/mfd/arizona-spi.c
>> @@ -17,6 +17,7 @@
>>   #include <linux/regulator/consumer.h>
>>   #include <linux/slab.h>
>>   #include <linux/spi/spi.h>
>> +#include <linux/acpi.h>
>>   #include <linux/of.h>
>>
>>   #include <linux/mfd/arizona/core.h>
>> @@ -82,6 +83,15 @@ static int arizona_spi_remove(struct spi_device *spi)
>>          return 0;
>>   }
>>
>> +#ifdef CONFIG_ACPI
>> +static struct acpi_device_id wm5102_acpi_match[] = {
>> +               { "WM5102", 0},
>> +               { "WM510205", 0},
>> +               { },
>> +};
>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>> +#endif
>> +
>>   static const struct spi_device_id arizona_spi_ids[] = {
>>          { "wm5102", WM5102 },
>>          { "wm5110", WM5110 },
>> @@ -96,6 +106,9 @@ static struct spi_driver arizona_spi_driver = {
>>                  .owner  = THIS_MODULE,
>>                  .pm     = &arizona_pm_ops,
>>                  .of_match_table = of_match_ptr(arizona_of_match),
>> +#ifdef CONFIG_ACPI
>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>> +#endif
>>          },
>>          .probe          = arizona_spi_probe,
>>          .remove         = arizona_spi_remove,
>>
>>
>>
>>
>> commit 268e21d29c942205e40f749c6d71c77839dc67da
>> Author: somebody anybody <somebody@foobar.com>
>> Date:   Wed May 13 11:36:04 2015 +0200
>>
>>      arizona : added ACPI id of wm5102 to i2c driver
>>
>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>
>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>> index ff782a5..45ece1b 100644
>> --- a/drivers/mfd/arizona-i2c.c
>> +++ b/drivers/mfd/arizona-i2c.c
>> @@ -18,6 +18,7 @@
>>   #include <linux/regulator/consumer.h>
>>   #include <linux/slab.h>
>>   #include <linux/of.h>
>> +#include <linux/acpi.h>
>>
>>   #include <linux/mfd/arizona/core.h>
>>
>> @@ -85,6 +86,15 @@ static int arizona_i2c_remove(struct i2c_client *i2c)
>>          return 0;
>>   }
>>
>> +#ifdef CONFIG_ACPI
>> +static struct acpi_device_id wm5102_acpi_match[] = {
>> +               { "WM5102", 0},
>> +               { "WM510205", 0},
>> +               { },
>
>
> Those IDs don't really look like ACPI ones? Isn't there a rule that the _HID
> is represented by a 4-letter vendor ID followed by part ID? see
> http://www.uefi.org/PNP_ACPI_Registry
>
>
>> +};
>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>> +#endif
>> +
>>   static const struct i2c_device_id arizona_i2c_id[] = {
>>          { "wm5102", WM5102 },
>>          { "wm5110", WM5110 },
>> @@ -100,6 +110,9 @@ static struct i2c_driver arizona_i2c_driver = {
>>                  .owner  = THIS_MODULE,
>>                  .pm     = &arizona_pm_ops,
>>                  .of_match_table = of_match_ptr(arizona_of_match),
>> +#ifdef CONFIG_ACPI
>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>> +#endif
>>          },
>>          .probe          = arizona_i2c_probe,
>>          .remove         = arizona_i2c_remove,
>>
>>
>>
>> with these two patches the local master branch compiles fine, but at
>> initialzing the arizona-spi driver gots a NULL pointer exception.
>>
>> I attach the whole dmesg of 4.1.0-rc3 (build 4.1.0.24-rc3).
>>
>> I need some assistance or hints to the right direction, I am looking
>> myself and I also try what I can, but I think it would be easy peasy
>> with some experts like here on this list :)
>>
>>
>> PS: the message : spi_master spi32766: raised num_chipselect to 20 for
>> WM510205:00
>>
>> is a dev_err() line added to the function static acpi_status
>> acpi_spi_add_device(), there I had raised the num_chipselect first
>> (that was wrong, the raise is now done as in the first patch above.
>> this is only a debug message and will be removed soon)
>>
>>
>> PPS: for me it seems that there is a missing 'link' from WM5102 to the
>> sst-acpi 80860F28:00 device, which complaints NOW / the first time
>> with the three patches applied on top on master.... will have a look
>> into it.
>>
>> I hope I got this device working with some more help from you.
>>
>> cheers
>> chris
>>
>>
>>
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
>



-- 
--
......oooO..............
.....(....).....Oooo...
......)../.....(....)....
.....(_/.......)../.....
...............(_/.......
... I WAS ..............
.......... HERE...... ;)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [WM5102/ARIZONA] spi driver needs to support ACPI
  2015-05-19  9:04   ` Christian Hartmann
@ 2015-05-19 13:39     ` Christian Hartmann
  2015-06-02  8:34       ` Christian Hartmann
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Hartmann @ 2015-05-19 13:39 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 7749 bytes --]

Hi,

at the moment I am totally confused. I thought adding an ACPI ID is
trivial, but it is not.

I have again a null pointer exception in arizona_spi_probe()

could it be with the new num_chipselect value in spi-pxa2xx.c ??
I attach the trace of the last try

Any hints or tips are welcome.

cheers
chris

2015-05-19 11:04 GMT+02:00 Christian Hartmann <cornogle@googlemail.com>:
> Hi,
>
> so the ACPI id string, which I want to add to arizona-spi.c should be
>
> WM510205 ??
>
> I have changed the ACPI string to
>
> {"WM510205", WM5102},
>
> now and give it a try.
>
> cheers
> chris
>
> 2015-05-18 18:29 GMT+02:00 Pierre-Louis Bossart
> <pierre-louis.bossart@linux.intel.com>:
>> On 5/15/15 4:16 AM, Christian Hartmann wrote:
>>>
>>> Hi list,
>>>
>>>
>>> I need ACPI support for the arizona-core / arizona-spi driver for the
>>> ACPI ID WM5102.
>>> This audio codec is build into the Lenovo Yoga 851F. This device is a
>>> 32Bit (UEFI) system
>>>
>>>
>>> http://support.lenovo.com/de/de/products/tablets/yoga-series/yoga-tablet-2-851
>>>
>>>
>>> I have tested with vanilla kernels from kernel.org 3.19.y ,4.0.y and
>>> master (from torvalds) currently its 4.1.0-rc3. As distribution I am
>>> working with Fedora / Fedlet was the initial install image.
>>>
>>> With all vanilla kernels I got at first an error message from spi32766:
>>>
>>> [ 0.296297] pxa2xx-spi 80860F0E:00: cs1 >= max 1
>>> [ 0.296311] spi_master spi32766: failed to add SPI device
>>> WM510205:00 from ACPI
>>>
>>> so I have at first patched as suggested by broonie the arizona-core
>>>
>>> commit 48203a0fede057d6a8c5f6872c53326395350f45
>>> Author: somebody anybody <somebody@foobar.com>
>>> Date:   Mon May 11 13:35:43 2015 +0200
>>>
>>>      spi-pxa2xx : raise chipselect
>>>
>>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>>
>>> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
>>> index e3223ac..9c919ea 100644
>>> --- a/drivers/spi/spi-pxa2xx.c
>>> +++ b/drivers/spi/spi-pxa2xx.c
>>> @@ -1279,7 +1279,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device
>>> *pdev)
>>>          if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0,
>>> &devid))
>>>                  ssp->port_id = devid;
>>>
>>> -       pdata->num_chipselect = 1;
>>> +       pdata->num_chipselect = 20;
>>>          pdata->enable_dma = true;
>>>
>>>          return pdata;
>>>
>>> This leds the spi master do the further ACPI configuration and inital
>>> setup for the arizona-spi device, but adding the ACPI ID to it
>>> does not work yet as expected:
>>>
>>> The current last patchset on top of master is
>>>
>>>
>>> Author: somebody anybody <somebody@foobar.com>
>>> Date:   Wed May 13 11:36:25 2015 +0200
>>>
>>>      arizona : added ACPI id of wm5102 to SPI driver, too
>>>
>>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>>
>>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>>> index 1e845f6..c19a4c1 100644
>>> --- a/drivers/mfd/arizona-spi.c
>>> +++ b/drivers/mfd/arizona-spi.c
>>> @@ -17,6 +17,7 @@
>>>   #include <linux/regulator/consumer.h>
>>>   #include <linux/slab.h>
>>>   #include <linux/spi/spi.h>
>>> +#include <linux/acpi.h>
>>>   #include <linux/of.h>
>>>
>>>   #include <linux/mfd/arizona/core.h>
>>> @@ -82,6 +83,15 @@ static int arizona_spi_remove(struct spi_device *spi)
>>>          return 0;
>>>   }
>>>
>>> +#ifdef CONFIG_ACPI
>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>> +               { "WM5102", 0},
>>> +               { "WM510205", 0},
>>> +               { },
>>> +};
>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>> +#endif
>>> +
>>>   static const struct spi_device_id arizona_spi_ids[] = {
>>>          { "wm5102", WM5102 },
>>>          { "wm5110", WM5110 },
>>> @@ -96,6 +106,9 @@ static struct spi_driver arizona_spi_driver = {
>>>                  .owner  = THIS_MODULE,
>>>                  .pm     = &arizona_pm_ops,
>>>                  .of_match_table = of_match_ptr(arizona_of_match),
>>> +#ifdef CONFIG_ACPI
>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>> +#endif
>>>          },
>>>          .probe          = arizona_spi_probe,
>>>          .remove         = arizona_spi_remove,
>>>
>>>
>>>
>>>
>>> commit 268e21d29c942205e40f749c6d71c77839dc67da
>>> Author: somebody anybody <somebody@foobar.com>
>>> Date:   Wed May 13 11:36:04 2015 +0200
>>>
>>>      arizona : added ACPI id of wm5102 to i2c driver
>>>
>>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>>
>>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>>> index ff782a5..45ece1b 100644
>>> --- a/drivers/mfd/arizona-i2c.c
>>> +++ b/drivers/mfd/arizona-i2c.c
>>> @@ -18,6 +18,7 @@
>>>   #include <linux/regulator/consumer.h>
>>>   #include <linux/slab.h>
>>>   #include <linux/of.h>
>>> +#include <linux/acpi.h>
>>>
>>>   #include <linux/mfd/arizona/core.h>
>>>
>>> @@ -85,6 +86,15 @@ static int arizona_i2c_remove(struct i2c_client *i2c)
>>>          return 0;
>>>   }
>>>
>>> +#ifdef CONFIG_ACPI
>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>> +               { "WM5102", 0},
>>> +               { "WM510205", 0},
>>> +               { },
>>
>>
>> Those IDs don't really look like ACPI ones? Isn't there a rule that the _HID
>> is represented by a 4-letter vendor ID followed by part ID? see
>> http://www.uefi.org/PNP_ACPI_Registry
>>
>>
>>> +};
>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>> +#endif
>>> +
>>>   static const struct i2c_device_id arizona_i2c_id[] = {
>>>          { "wm5102", WM5102 },
>>>          { "wm5110", WM5110 },
>>> @@ -100,6 +110,9 @@ static struct i2c_driver arizona_i2c_driver = {
>>>                  .owner  = THIS_MODULE,
>>>                  .pm     = &arizona_pm_ops,
>>>                  .of_match_table = of_match_ptr(arizona_of_match),
>>> +#ifdef CONFIG_ACPI
>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>> +#endif
>>>          },
>>>          .probe          = arizona_i2c_probe,
>>>          .remove         = arizona_i2c_remove,
>>>
>>>
>>>
>>> with these two patches the local master branch compiles fine, but at
>>> initialzing the arizona-spi driver gots a NULL pointer exception.
>>>
>>> I attach the whole dmesg of 4.1.0-rc3 (build 4.1.0.24-rc3).
>>>
>>> I need some assistance or hints to the right direction, I am looking
>>> myself and I also try what I can, but I think it would be easy peasy
>>> with some experts like here on this list :)
>>>
>>>
>>> PS: the message : spi_master spi32766: raised num_chipselect to 20 for
>>> WM510205:00
>>>
>>> is a dev_err() line added to the function static acpi_status
>>> acpi_spi_add_device(), there I had raised the num_chipselect first
>>> (that was wrong, the raise is now done as in the first patch above.
>>> this is only a debug message and will be removed soon)
>>>
>>>
>>> PPS: for me it seems that there is a missing 'link' from WM5102 to the
>>> sst-acpi 80860F28:00 device, which complaints NOW / the first time
>>> with the three patches applied on top on master.... will have a look
>>> into it.
>>>
>>> I hope I got this device working with some more help from you.
>>>
>>> cheers
>>> chris
>>>
>>>
>>>
>>> _______________________________________________
>>> Alsa-devel mailing list
>>> Alsa-devel@alsa-project.org
>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>
>>
>
>
>
> --
> --
> ......oooO..............
> .....(....).....Oooo...
> ......)../.....(....)....
> .....(_/.......)../.....
> ...............(_/.......
> ... I WAS ..............
> .......... HERE...... ;)



-- 
--
......oooO..............
.....(....).....Oooo...
......)../.....(....)....
.....(_/.......)../.....
...............(_/.......
... I WAS ..............
.......... HERE...... ;)

[-- Attachment #2: bug.txt --]
[-- Type: text/plain, Size: 3443 bytes --]

[    5.772216] BUG: unable to handle kernel NULL pointer dereference at 00000020
[    5.779625] IP: [<f7e9a043>] arizona_spi_probe+0x23/0xf4 [arizona_spi]
[    5.787016] *pde = 00000000 
[    5.794351] Oops: 0000 [#1] SMP 
[    5.801668] Modules linked in: int3403_thermal(+) int3400_thermal(+) acpi_thermal_rel arizona_spi(+) int340x_thermal_zone pwm_lpss_platform rfkill_gpio pwm_lpss arizona_i2c snd_soc_sst_acpi i2c_designware_platform(+) acpi_pad rfkill i2c_designware_core ax88179_178a usbnet mii
[    5.817124] CPU: 1 PID: 429 Comm: systemd-udevd Not tainted 4.1.0.28-rc4 #137
[    5.824944] Hardware name: LENOVO 60072/INVALID, BIOS 02WT18WW 08/01/2014
[    5.832822] task: f41f8000 ti: f4136000 task.ti: f4136000
[    5.840695] EIP: 0060:[<f7e9a043>] EFLAGS: 00010246 CPU: 1
[    5.848572] EIP is at arizona_spi_probe+0x23/0xf4 [arizona_spi]
[    5.856456] EAX: 00000000 EBX: f4bbb800 ECX: f7e9c010 EDX: f7e9b0c8
[    5.864375] ESI: 00000000 EDI: f7e9c000 EBP: f4137ce8 ESP: f4137ccc
[    5.872276]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[    5.880187] CR0: 80050033 CR2: 00000020 CR3: 36d9a000 CR4: 001007d0
[    5.888134] Stack:
[    5.896023]  f4137ce0 c0744192 f4bbb800 f4bbb800 00000000 f4bbb800 f7e9c000 f4137cfc
[    5.904090]  c091b534 f4bbb800 f7e9c010 00000000 f4137d30 c08a156a f7e9c060 f7e9c010
[    5.912227]  f4137d1c c07465e7 666b9647 f4bbb834 00000014 f4bbb834 f4bbb800 f7e9c010
[    5.920407] Call Trace:
[    5.928510]  [<c0744192>] ? acpi_dev_pm_attach+0x57/0x79
[    5.936666]  [<c091b534>] spi_drv_probe+0x34/0x60
[    5.944836]  [<c08a156a>] driver_probe_device+0x1ba/0x400
[    5.953041]  [<c07465e7>] ? acpi_driver_match_device+0x36/0x3f
[    5.961275]  [<c08a1861>] __driver_attach+0x71/0x80
[    5.969512]  [<c08a17f0>] ? __device_attach+0x40/0x40
[    5.977748]  [<c089f827>] bus_for_each_dev+0x57/0xa0
[    5.985995]  [<c08a0f4e>] driver_attach+0x1e/0x20
[    5.994234]  [<c08a17f0>] ? __device_attach+0x40/0x40
[    6.002476]  [<c08a0b97>] bus_add_driver+0x157/0x230
[    6.010715]  [<f7e9f000>] ? 0xf7e9f000
[    6.018932]  [<f7e9f000>] ? 0xf7e9f000
[    6.027146]  [<c08a1f69>] driver_register+0x59/0xe0
[    6.035420]  [<c06d3820>] ? kvasprintf+0x40/0x50
[    6.043695]  [<c091b4b1>] spi_register_driver+0x41/0x50
[    6.051991]  [<f7e9f00d>] arizona_spi_driver_init+0xd/0x1000 [arizona_spi]
[    6.060360]  [<c0400472>] do_one_initcall+0xc2/0x1f0
[    6.068728]  [<f7e9f000>] ? 0xf7e9f000
[    6.077084]  [<c052b3b3>] ? free_pages_prepare+0x1c3/0x360
[    6.085482]  [<c0569d7d>] ? kmem_cache_alloc_trace+0x17d/0x1e0
[    6.093878]  [<c05694bf>] ? kfree+0xcf/0x100
[    6.102240]  [<c0b2e3de>] ? do_init_module+0x24/0x1ae
[    6.110563]  [<c0b2e40d>] do_init_module+0x53/0x1ae
[    6.118823]  [<c04c4ee4>] load_module+0x1034/0x16b0
[    6.127016]  [<c04c1ef9>] ? copy_module_from_fd.isra.48+0x109/0x1a0
[    6.135281]  [<c04c574d>] SyS_finit_module+0x8d/0xd0
[    6.143545]  [<c053f143>] ? vm_mmap_pgoff+0x93/0xb0
[    6.151813]  [<c0b3b38f>] sysenter_do_call+0x12/0x12
[    6.160097] Code: 00 00 8d bf 00 00 00 00 55 89 e5 57 56 53 83 ec 10 3e 8d 74 26 00 89 c3 e8 db 23 a8 c8 85 db 89 c6 74 35 8b 83 70 01 00 00 85 c0 <8b> 46 20 74 2b 89 44 24 08 c7 44 24 04 24 b0 e9 f7 89 1c 24 e8
[    6.177597] EIP: [<f7e9a043>] arizona_spi_probe+0x23/0xf4 [arizona_spi] SS:ESP 0068:f4137ccc
[    6.186298] CR2: 0000000000000020
[    6.998720] intel_sst_acpi 80860F28:00: No matching machine driver found

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [WM5102/ARIZONA] spi driver needs to support ACPI
  2015-05-19 13:39     ` Christian Hartmann
@ 2015-06-02  8:34       ` Christian Hartmann
  2015-06-02 18:13         ` Pierre-Louis Bossart
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Hartmann @ 2015-06-02  8:34 UTC (permalink / raw)
  To: alsa-devel

hi list again,

I have patched the torvalds/master branch currently rc6
and I have no NULL pointer exception anymore.

I will send each patch separately

Of course no (working) soundcard yet..

so let be try to describe what is actually open or resolved for me:

* the spi master 37622 (pxa2xx) does not fail to add the SPI slave spi-WM510205
pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00

* ALSA device list: no soundcards found
* in dmesg I found two message indicating that something seems to be
missing yet:

sst-acpi 80860F28:00: No matching ASoC machine driver found
intel-sst-acpi 80860F28:00: No matching machine driver found


snip of dmesg 4.1.0.42-rc6


[    6.075170] sst-acpi 80860F28:00: No matching ASoC machine driver found
[    6.106787] pxa2xx-spi 80860F0E:00: no DMA channels available, using PIO
[    6.106865] pxa2xx-spi 80860F0E:00: registered master spi32766 (dynamic)
[    6.107058] spi spi-WM510205:00: 8333333 Hz actual, PIO
[    6.107065] spi spi-WM510205:00: setup mode 0, 8 bits/w, 8000000 Hz max --> 0
[    6.107151] pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00
[    6.114510] rfkill_gpio LNV4752:00: GPIO lookup for consumer reset
[    6.114519] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
[    6.114526] acpi LNV4752:00: GPIO: looking up reset-gpios
[    6.114533] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 0 0 0
[    6.114607] no flags found for reset
[    6.114619] rfkill_gpio LNV4752:00: GPIO lookup for consumer shutdown
[    6.114623] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
[    6.114628] acpi LNV4752:00: GPIO: looking up shutdown-gpios
[    6.114633] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 1 0 0
[    6.114669] acpi LNV4752:00: GPIO: looking up shutdown-gpio
[    6.114675] acpi LNV4752:00: GPIO: looking up 0 in _CRS
[    6.114711] gpio-411 (reset): gpiod_request: status -16
[    6.114849] rfkill_gpio LNV4752:00: LNV4752:00 device registered.
[    6.247784] intel_sst_acpi 80860F28:00: No matching machine driver found


I have grepped the string 80860F28 in the ACPI DSDT table (->
dsdt.dsl) and found

    {
        Device (LPEA)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F28" /* Intel SST Audio DSP */)  //
_HID: Hardware ID
            Name (_CID, "80860F28" /* Intel SST Audio DSP */)  //
_CID: Compatible ID
            Name (_DDN, "Intel(R) Low Power Audio Controller -
80860F28")  // _DDN: DOS Device Name
            Name (_SUB, "17AA7004")  // _SUB: Subsystem ID
            Name (_UID, One)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                ^SPI1.AUDI
            })
            Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
            {
                PLPE
            })
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (LAnd (LEqual (LPEE, 0x02), LEqual (LPED, Zero)))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

So how to bind the intel_sst_acpi with the WM5102 arizona coded and
its hub named arizone ???

Any suggestions or new directions?
....


cheers
chris


2015-05-19 15:39 GMT+02:00 Christian Hartmann <cornogle@googlemail.com>:
> Hi,
>
> at the moment I am totally confused. I thought adding an ACPI ID is
> trivial, but it is not.
>
> I have again a null pointer exception in arizona_spi_probe()
>
> could it be with the new num_chipselect value in spi-pxa2xx.c ??
> I attach the trace of the last try
>
> Any hints or tips are welcome.
>
> cheers
> chris
>
> 2015-05-19 11:04 GMT+02:00 Christian Hartmann <cornogle@googlemail.com>:
>> Hi,
>>
>> so the ACPI id string, which I want to add to arizona-spi.c should be
>>
>> WM510205 ??
>>
>> I have changed the ACPI string to
>>
>> {"WM510205", WM5102},
>>
>> now and give it a try.
>>
>> cheers
>> chris
>>
>> 2015-05-18 18:29 GMT+02:00 Pierre-Louis Bossart
>> <pierre-louis.bossart@linux.intel.com>:
>>> On 5/15/15 4:16 AM, Christian Hartmann wrote:
>>>>
>>>> Hi list,
>>>>
>>>>
>>>> I need ACPI support for the arizona-core / arizona-spi driver for the
>>>> ACPI ID WM5102.
>>>> This audio codec is build into the Lenovo Yoga 851F. This device is a
>>>> 32Bit (UEFI) system
>>>>
>>>>
>>>> http://support.lenovo.com/de/de/products/tablets/yoga-series/yoga-tablet-2-851
>>>>
>>>>
>>>> I have tested with vanilla kernels from kernel.org 3.19.y ,4.0.y and
>>>> master (from torvalds) currently its 4.1.0-rc3. As distribution I am
>>>> working with Fedora / Fedlet was the initial install image.
>>>>
>>>> With all vanilla kernels I got at first an error message from spi32766:
>>>>
>>>> [ 0.296297] pxa2xx-spi 80860F0E:00: cs1 >= max 1
>>>> [ 0.296311] spi_master spi32766: failed to add SPI device
>>>> WM510205:00 from ACPI
>>>>
>>>> so I have at first patched as suggested by broonie the arizona-core
>>>>
>>>> commit 48203a0fede057d6a8c5f6872c53326395350f45
>>>> Author: somebody anybody <somebody@foobar.com>
>>>> Date:   Mon May 11 13:35:43 2015 +0200
>>>>
>>>>      spi-pxa2xx : raise chipselect
>>>>
>>>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>
>>>> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
>>>> index e3223ac..9c919ea 100644
>>>> --- a/drivers/spi/spi-pxa2xx.c
>>>> +++ b/drivers/spi/spi-pxa2xx.c
>>>> @@ -1279,7 +1279,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device
>>>> *pdev)
>>>>          if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0,
>>>> &devid))
>>>>                  ssp->port_id = devid;
>>>>
>>>> -       pdata->num_chipselect = 1;
>>>> +       pdata->num_chipselect = 20;
>>>>          pdata->enable_dma = true;
>>>>
>>>>          return pdata;
>>>>
>>>> This leds the spi master do the further ACPI configuration and inital
>>>> setup for the arizona-spi device, but adding the ACPI ID to it
>>>> does not work yet as expected:
>>>>
>>>> The current last patchset on top of master is
>>>>
>>>>
>>>> Author: somebody anybody <somebody@foobar.com>
>>>> Date:   Wed May 13 11:36:25 2015 +0200
>>>>
>>>>      arizona : added ACPI id of wm5102 to SPI driver, too
>>>>
>>>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>
>>>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>>>> index 1e845f6..c19a4c1 100644
>>>> --- a/drivers/mfd/arizona-spi.c
>>>> +++ b/drivers/mfd/arizona-spi.c
>>>> @@ -17,6 +17,7 @@
>>>>   #include <linux/regulator/consumer.h>
>>>>   #include <linux/slab.h>
>>>>   #include <linux/spi/spi.h>
>>>> +#include <linux/acpi.h>
>>>>   #include <linux/of.h>
>>>>
>>>>   #include <linux/mfd/arizona/core.h>
>>>> @@ -82,6 +83,15 @@ static int arizona_spi_remove(struct spi_device *spi)
>>>>          return 0;
>>>>   }
>>>>
>>>> +#ifdef CONFIG_ACPI
>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>> +               { "WM5102", 0},
>>>> +               { "WM510205", 0},
>>>> +               { },
>>>> +};
>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>> +#endif
>>>> +
>>>>   static const struct spi_device_id arizona_spi_ids[] = {
>>>>          { "wm5102", WM5102 },
>>>>          { "wm5110", WM5110 },
>>>> @@ -96,6 +106,9 @@ static struct spi_driver arizona_spi_driver = {
>>>>                  .owner  = THIS_MODULE,
>>>>                  .pm     = &arizona_pm_ops,
>>>>                  .of_match_table = of_match_ptr(arizona_of_match),
>>>> +#ifdef CONFIG_ACPI
>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>> +#endif
>>>>          },
>>>>          .probe          = arizona_spi_probe,
>>>>          .remove         = arizona_spi_remove,
>>>>
>>>>
>>>>
>>>>
>>>> commit 268e21d29c942205e40f749c6d71c77839dc67da
>>>> Author: somebody anybody <somebody@foobar.com>
>>>> Date:   Wed May 13 11:36:04 2015 +0200
>>>>
>>>>      arizona : added ACPI id of wm5102 to i2c driver
>>>>
>>>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>
>>>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>>>> index ff782a5..45ece1b 100644
>>>> --- a/drivers/mfd/arizona-i2c.c
>>>> +++ b/drivers/mfd/arizona-i2c.c
>>>> @@ -18,6 +18,7 @@
>>>>   #include <linux/regulator/consumer.h>
>>>>   #include <linux/slab.h>
>>>>   #include <linux/of.h>
>>>> +#include <linux/acpi.h>
>>>>
>>>>   #include <linux/mfd/arizona/core.h>
>>>>
>>>> @@ -85,6 +86,15 @@ static int arizona_i2c_remove(struct i2c_client *i2c)
>>>>          return 0;
>>>>   }
>>>>
>>>> +#ifdef CONFIG_ACPI
>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>> +               { "WM5102", 0},
>>>> +               { "WM510205", 0},
>>>> +               { },
>>>
>>>
>>> Those IDs don't really look like ACPI ones? Isn't there a rule that the _HID
>>> is represented by a 4-letter vendor ID followed by part ID? see
>>> http://www.uefi.org/PNP_ACPI_Registry
>>>
>>>
>>>> +};
>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>> +#endif
>>>> +
>>>>   static const struct i2c_device_id arizona_i2c_id[] = {
>>>>          { "wm5102", WM5102 },
>>>>          { "wm5110", WM5110 },
>>>> @@ -100,6 +110,9 @@ static struct i2c_driver arizona_i2c_driver = {
>>>>                  .owner  = THIS_MODULE,
>>>>                  .pm     = &arizona_pm_ops,
>>>>                  .of_match_table = of_match_ptr(arizona_of_match),
>>>> +#ifdef CONFIG_ACPI
>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>> +#endif
>>>>          },
>>>>          .probe          = arizona_i2c_probe,
>>>>          .remove         = arizona_i2c_remove,
>>>>
>>>>
>>>>
>>>> with these two patches the local master branch compiles fine, but at
>>>> initialzing the arizona-spi driver gots a NULL pointer exception.
>>>>
>>>> I attach the whole dmesg of 4.1.0-rc3 (build 4.1.0.24-rc3).
>>>>
>>>> I need some assistance or hints to the right direction, I am looking
>>>> myself and I also try what I can, but I think it would be easy peasy
>>>> with some experts like here on this list :)
>>>>
>>>>
>>>> PS: the message : spi_master spi32766: raised num_chipselect to 20 for
>>>> WM510205:00
>>>>
>>>> is a dev_err() line added to the function static acpi_status
>>>> acpi_spi_add_device(), there I had raised the num_chipselect first
>>>> (that was wrong, the raise is now done as in the first patch above.
>>>> this is only a debug message and will be removed soon)
>>>>
>>>>
>>>> PPS: for me it seems that there is a missing 'link' from WM5102 to the
>>>> sst-acpi 80860F28:00 device, which complaints NOW / the first time
>>>> with the three patches applied on top on master.... will have a look
>>>> into it.
>>>>
>>>> I hope I got this device working with some more help from you.
>>>>
>>>> cheers
>>>> chris
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Alsa-devel mailing list
>>>> Alsa-devel@alsa-project.org
>>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>>
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [WM5102/ARIZONA] spi driver needs to support ACPI
  2015-06-02  8:34       ` Christian Hartmann
@ 2015-06-02 18:13         ` Pierre-Louis Bossart
       [not found]           ` <CAKor6Tf-SUof0RgQazOEJHnojAcDZq88a-TybD-oYEmS=fLLig@mail.gmail.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre-Louis Bossart @ 2015-06-02 18:13 UTC (permalink / raw)
  To: Christian Hartmann, alsa-devel

On 06/02/2015 03:34 AM, Christian Hartmann wrote:
> hi list again,
> 
> I have patched the torvalds/master branch currently rc6
> and I have no NULL pointer exception anymore.
> 
> I will send each patch separately
> 
> Of course no (working) soundcard yet..
> 
> so let be try to describe what is actually open or resolved for me:
> 
> * the spi master 37622 (pxa2xx) does not fail to add the SPI slave spi-WM510205
> pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00
> 
> * ALSA device list: no soundcards found
> * in dmesg I found two message indicating that something seems to be
> missing yet:
> 
> sst-acpi 80860F28:00: No matching ASoC machine driver found
> intel-sst-acpi 80860F28:00: No matching machine driver found
> 
> 
> snip of dmesg 4.1.0.42-rc6
> 
> 
> [    6.075170] sst-acpi 80860F28:00: No matching ASoC machine driver found
> [    6.106787] pxa2xx-spi 80860F0E:00: no DMA channels available, using PIO
> [    6.106865] pxa2xx-spi 80860F0E:00: registered master spi32766 (dynamic)
> [    6.107058] spi spi-WM510205:00: 8333333 Hz actual, PIO
> [    6.107065] spi spi-WM510205:00: setup mode 0, 8 bits/w, 8000000 Hz max --> 0
> [    6.107151] pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00
> [    6.114510] rfkill_gpio LNV4752:00: GPIO lookup for consumer reset
> [    6.114519] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
> [    6.114526] acpi LNV4752:00: GPIO: looking up reset-gpios
> [    6.114533] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 0 0 0
> [    6.114607] no flags found for reset
> [    6.114619] rfkill_gpio LNV4752:00: GPIO lookup for consumer shutdown
> [    6.114623] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
> [    6.114628] acpi LNV4752:00: GPIO: looking up shutdown-gpios
> [    6.114633] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 1 0 0
> [    6.114669] acpi LNV4752:00: GPIO: looking up shutdown-gpio
> [    6.114675] acpi LNV4752:00: GPIO: looking up 0 in _CRS
> [    6.114711] gpio-411 (reset): gpiod_request: status -16
> [    6.114849] rfkill_gpio LNV4752:00: LNV4752:00 device registered.
> [    6.247784] intel_sst_acpi 80860F28:00: No matching machine driver found
> 
> 
> I have grepped the string 80860F28 in the ACPI DSDT table (->
> dsdt.dsl) and found
> 
>     {
>         Device (LPEA)
>         {
>             Name (_ADR, Zero)  // _ADR: Address
>             Name (_HID, "80860F28" /* Intel SST Audio DSP */)  //
> _HID: Hardware ID
>             Name (_CID, "80860F28" /* Intel SST Audio DSP */)  //
> _CID: Compatible ID
>             Name (_DDN, "Intel(R) Low Power Audio Controller -
> 80860F28")  // _DDN: DOS Device Name
>             Name (_SUB, "17AA7004")  // _SUB: Subsystem ID
>             Name (_UID, One)  // _UID: Unique ID
>             Name (_DEP, Package (0x01)  // _DEP: Dependencies
>             {
>                 ^SPI1.AUDI
>             })
>             Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
>             {
>                 PLPE
>             })
>             Method (_STA, 0, NotSerialized)  // _STA: Status
>             {
>                 If (LAnd (LEqual (LPEE, 0x02), LEqual (LPED, Zero)))
>                 {
>                     Return (0x0F)
>                 }
> 
>                 Return (Zero)
>             }
> 
> So how to bind the intel_sst_acpi with the WM5102 arizona coded and
> its hub named arizone ???
> 
> Any suggestions or new directions?

In your DSDT table, you need to leave the LPEA device alone. this is Intel only

You will need to have a second device for your codec that is either a child of the I2C (or SPI?) controllers. This second device will have an HID that you need to include in the sst-acpi.c code. when the LPEA driver starts, it will look if this codec HID is present and if yes load the relevant machine driver and firmware.

see for example the baytrail code, it uses the codec ID to identify which machine driver is needed. this is where you would need to add the wolfson HID.

static struct sst_acpi_mach baytrail_machines[] = {
	{ "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
	{ "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
	{}
};


Maybe you can share your DSDT table (factory settings) if you want more help.
Also note that HIDs are specified based on rules defined by uefi.org, the "WM5102" does not follow any of the usual conventions. My guess is that the HID should be prefixed by the Wolfson PCI vendor ID.


> ....
>  
> 
> cheers
> chris
> 
> 
> 2015-05-19 15:39 GMT+02:00 Christian Hartmann <cornogle@googlemail.com>:
>> Hi,
>>
>> at the moment I am totally confused. I thought adding an ACPI ID is
>> trivial, but it is not.
>>
>> I have again a null pointer exception in arizona_spi_probe()
>>
>> could it be with the new num_chipselect value in spi-pxa2xx.c ??
>> I attach the trace of the last try
>>
>> Any hints or tips are welcome.
>>
>> cheers
>> chris
>>
>> 2015-05-19 11:04 GMT+02:00 Christian Hartmann <cornogle@googlemail.com>:
>>> Hi,
>>>
>>> so the ACPI id string, which I want to add to arizona-spi.c should be
>>>
>>> WM510205 ??
>>>
>>> I have changed the ACPI string to
>>>
>>> {"WM510205", WM5102},
>>>
>>> now and give it a try.
>>>
>>> cheers
>>> chris
>>>
>>> 2015-05-18 18:29 GMT+02:00 Pierre-Louis Bossart
>>> <pierre-louis.bossart@linux.intel.com>:
>>>> On 5/15/15 4:16 AM, Christian Hartmann wrote:
>>>>>
>>>>> Hi list,
>>>>>
>>>>>
>>>>> I need ACPI support for the arizona-core / arizona-spi driver for the
>>>>> ACPI ID WM5102.
>>>>> This audio codec is build into the Lenovo Yoga 851F. This device is a
>>>>> 32Bit (UEFI) system
>>>>>
>>>>>
>>>>> http://support.lenovo.com/de/de/products/tablets/yoga-series/yoga-tablet-2-851
>>>>>
>>>>>
>>>>> I have tested with vanilla kernels from kernel.org 3.19.y ,4.0.y and
>>>>> master (from torvalds) currently its 4.1.0-rc3. As distribution I am
>>>>> working with Fedora / Fedlet was the initial install image.
>>>>>
>>>>> With all vanilla kernels I got at first an error message from spi32766:
>>>>>
>>>>> [ 0.296297] pxa2xx-spi 80860F0E:00: cs1 >= max 1
>>>>> [ 0.296311] spi_master spi32766: failed to add SPI device
>>>>> WM510205:00 from ACPI
>>>>>
>>>>> so I have at first patched as suggested by broonie the arizona-core
>>>>>
>>>>> commit 48203a0fede057d6a8c5f6872c53326395350f45
>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>> Date:   Mon May 11 13:35:43 2015 +0200
>>>>>
>>>>>      spi-pxa2xx : raise chipselect
>>>>>
>>>>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>
>>>>> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
>>>>> index e3223ac..9c919ea 100644
>>>>> --- a/drivers/spi/spi-pxa2xx.c
>>>>> +++ b/drivers/spi/spi-pxa2xx.c
>>>>> @@ -1279,7 +1279,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device
>>>>> *pdev)
>>>>>          if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0,
>>>>> &devid))
>>>>>                  ssp->port_id = devid;
>>>>>
>>>>> -       pdata->num_chipselect = 1;
>>>>> +       pdata->num_chipselect = 20;
>>>>>          pdata->enable_dma = true;
>>>>>
>>>>>          return pdata;
>>>>>
>>>>> This leds the spi master do the further ACPI configuration and inital
>>>>> setup for the arizona-spi device, but adding the ACPI ID to it
>>>>> does not work yet as expected:
>>>>>
>>>>> The current last patchset on top of master is
>>>>>
>>>>>
>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>> Date:   Wed May 13 11:36:25 2015 +0200
>>>>>
>>>>>      arizona : added ACPI id of wm5102 to SPI driver, too
>>>>>
>>>>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>
>>>>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>>>>> index 1e845f6..c19a4c1 100644
>>>>> --- a/drivers/mfd/arizona-spi.c
>>>>> +++ b/drivers/mfd/arizona-spi.c
>>>>> @@ -17,6 +17,7 @@
>>>>>   #include <linux/regulator/consumer.h>
>>>>>   #include <linux/slab.h>
>>>>>   #include <linux/spi/spi.h>
>>>>> +#include <linux/acpi.h>
>>>>>   #include <linux/of.h>
>>>>>
>>>>>   #include <linux/mfd/arizona/core.h>
>>>>> @@ -82,6 +83,15 @@ static int arizona_spi_remove(struct spi_device *spi)
>>>>>          return 0;
>>>>>   }
>>>>>
>>>>> +#ifdef CONFIG_ACPI
>>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>>> +               { "WM5102", 0},
>>>>> +               { "WM510205", 0},
>>>>> +               { },
>>>>> +};
>>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>>> +#endif
>>>>> +
>>>>>   static const struct spi_device_id arizona_spi_ids[] = {
>>>>>          { "wm5102", WM5102 },
>>>>>          { "wm5110", WM5110 },
>>>>> @@ -96,6 +106,9 @@ static struct spi_driver arizona_spi_driver = {
>>>>>                  .owner  = THIS_MODULE,
>>>>>                  .pm     = &arizona_pm_ops,
>>>>>                  .of_match_table = of_match_ptr(arizona_of_match),
>>>>> +#ifdef CONFIG_ACPI
>>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>>> +#endif
>>>>>          },
>>>>>          .probe          = arizona_spi_probe,
>>>>>          .remove         = arizona_spi_remove,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> commit 268e21d29c942205e40f749c6d71c77839dc67da
>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>> Date:   Wed May 13 11:36:04 2015 +0200
>>>>>
>>>>>      arizona : added ACPI id of wm5102 to i2c driver
>>>>>
>>>>>      Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>
>>>>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>>>>> index ff782a5..45ece1b 100644
>>>>> --- a/drivers/mfd/arizona-i2c.c
>>>>> +++ b/drivers/mfd/arizona-i2c.c
>>>>> @@ -18,6 +18,7 @@
>>>>>   #include <linux/regulator/consumer.h>
>>>>>   #include <linux/slab.h>
>>>>>   #include <linux/of.h>
>>>>> +#include <linux/acpi.h>
>>>>>
>>>>>   #include <linux/mfd/arizona/core.h>
>>>>>
>>>>> @@ -85,6 +86,15 @@ static int arizona_i2c_remove(struct i2c_client *i2c)
>>>>>          return 0;
>>>>>   }
>>>>>
>>>>> +#ifdef CONFIG_ACPI
>>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>>> +               { "WM5102", 0},
>>>>> +               { "WM510205", 0},
>>>>> +               { },
>>>>
>>>>
>>>> Those IDs don't really look like ACPI ones? Isn't there a rule that the _HID
>>>> is represented by a 4-letter vendor ID followed by part ID? see
>>>> http://www.uefi.org/PNP_ACPI_Registry
>>>>
>>>>
>>>>> +};
>>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>>> +#endif
>>>>> +
>>>>>   static const struct i2c_device_id arizona_i2c_id[] = {
>>>>>          { "wm5102", WM5102 },
>>>>>          { "wm5110", WM5110 },
>>>>> @@ -100,6 +110,9 @@ static struct i2c_driver arizona_i2c_driver = {
>>>>>                  .owner  = THIS_MODULE,
>>>>>                  .pm     = &arizona_pm_ops,
>>>>>                  .of_match_table = of_match_ptr(arizona_of_match),
>>>>> +#ifdef CONFIG_ACPI
>>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>>> +#endif
>>>>>          },
>>>>>          .probe          = arizona_i2c_probe,
>>>>>          .remove         = arizona_i2c_remove,
>>>>>
>>>>>
>>>>>
>>>>> with these two patches the local master branch compiles fine, but at
>>>>> initialzing the arizona-spi driver gots a NULL pointer exception.
>>>>>
>>>>> I attach the whole dmesg of 4.1.0-rc3 (build 4.1.0.24-rc3).
>>>>>
>>>>> I need some assistance or hints to the right direction, I am looking
>>>>> myself and I also try what I can, but I think it would be easy peasy
>>>>> with some experts like here on this list :)
>>>>>
>>>>>
>>>>> PS: the message : spi_master spi32766: raised num_chipselect to 20 for
>>>>> WM510205:00
>>>>>
>>>>> is a dev_err() line added to the function static acpi_status
>>>>> acpi_spi_add_device(), there I had raised the num_chipselect first
>>>>> (that was wrong, the raise is now done as in the first patch above.
>>>>> this is only a debug message and will be removed soon)
>>>>>
>>>>>
>>>>> PPS: for me it seems that there is a missing 'link' from WM5102 to the
>>>>> sst-acpi 80860F28:00 device, which complaints NOW / the first time
>>>>> with the three patches applied on top on master.... will have a look
>>>>> into it.
>>>>>
>>>>> I hope I got this device working with some more help from you.
>>>>>
>>>>> cheers
>>>>> chris
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Alsa-devel mailing list
>>>>> Alsa-devel@alsa-project.org
>>>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>>>
>>>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [WM5102/ARIZONA] spi driver needs to support ACPI
       [not found]           ` <CAKor6Tf-SUof0RgQazOEJHnojAcDZq88a-TybD-oYEmS=fLLig@mail.gmail.com>
@ 2015-06-03 14:59             ` Pierre-Louis Bossart
  2015-06-04  7:23               ` Christian Hartmann
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre-Louis Bossart @ 2015-06-03 14:59 UTC (permalink / raw)
  To: Christian Hartmann; +Cc: alsa-devel

On 6/3/15 2:50 AM, Christian Hartmann wrote:
> hi,
>
> thanks Pierre-Luis,
>
> I attach the DSDT table in ASM format to get this device working as
> soon as possible.

this format is unreadable, can you extract the plain DSL instead, e.g. 
with iasl -d dsdt.dat -> extracts dsdt.dsl with only the code in 
'human-readable' format.

>
> By the way, I looked yesterday into the baytrail code (sound/soc/intel/sst )
> and I added this WM510205 codec.... but I do not know if I have it
> done correctly... currently I test my latest changes, seems to not
> work as expected yet.
>
>
> cheers
> chris
>
>
> 2015-06-02 20:13 GMT+02:00 Pierre-Louis Bossart
> <pierre-louis.bossart@linux.intel.com>:
>> On 06/02/2015 03:34 AM, Christian Hartmann wrote:
>>> hi list again,
>>>
>>> I have patched the torvalds/master branch currently rc6
>>> and I have no NULL pointer exception anymore.
>>>
>>> I will send each patch separately
>>>
>>> Of course no (working) soundcard yet..
>>>
>>> so let be try to describe what is actually open or resolved for me:
>>>
>>> * the spi master 37622 (pxa2xx) does not fail to add the SPI slave spi-WM510205
>>> pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00
>>>
>>> * ALSA device list: no soundcards found
>>> * in dmesg I found two message indicating that something seems to be
>>> missing yet:
>>>
>>> sst-acpi 80860F28:00: No matching ASoC machine driver found
>>> intel-sst-acpi 80860F28:00: No matching machine driver found
>>>
>>>
>>> snip of dmesg 4.1.0.42-rc6
>>>
>>>
>>> [    6.075170] sst-acpi 80860F28:00: No matching ASoC machine driver found
>>> [    6.106787] pxa2xx-spi 80860F0E:00: no DMA channels available, using PIO
>>> [    6.106865] pxa2xx-spi 80860F0E:00: registered master spi32766 (dynamic)
>>> [    6.107058] spi spi-WM510205:00: 8333333 Hz actual, PIO
>>> [    6.107065] spi spi-WM510205:00: setup mode 0, 8 bits/w, 8000000 Hz max --> 0
>>> [    6.107151] pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00
>>> [    6.114510] rfkill_gpio LNV4752:00: GPIO lookup for consumer reset
>>> [    6.114519] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
>>> [    6.114526] acpi LNV4752:00: GPIO: looking up reset-gpios
>>> [    6.114533] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 0 0 0
>>> [    6.114607] no flags found for reset
>>> [    6.114619] rfkill_gpio LNV4752:00: GPIO lookup for consumer shutdown
>>> [    6.114623] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
>>> [    6.114628] acpi LNV4752:00: GPIO: looking up shutdown-gpios
>>> [    6.114633] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 1 0 0
>>> [    6.114669] acpi LNV4752:00: GPIO: looking up shutdown-gpio
>>> [    6.114675] acpi LNV4752:00: GPIO: looking up 0 in _CRS
>>> [    6.114711] gpio-411 (reset): gpiod_request: status -16
>>> [    6.114849] rfkill_gpio LNV4752:00: LNV4752:00 device registered.
>>> [    6.247784] intel_sst_acpi 80860F28:00: No matching machine driver found
>>>
>>>
>>> I have grepped the string 80860F28 in the ACPI DSDT table (->
>>> dsdt.dsl) and found
>>>
>>>      {
>>>          Device (LPEA)
>>>          {
>>>              Name (_ADR, Zero)  // _ADR: Address
>>>              Name (_HID, "80860F28" /* Intel SST Audio DSP */)  //
>>> _HID: Hardware ID
>>>              Name (_CID, "80860F28" /* Intel SST Audio DSP */)  //
>>> _CID: Compatible ID
>>>              Name (_DDN, "Intel(R) Low Power Audio Controller -
>>> 80860F28")  // _DDN: DOS Device Name
>>>              Name (_SUB, "17AA7004")  // _SUB: Subsystem ID
>>>              Name (_UID, One)  // _UID: Unique ID
>>>              Name (_DEP, Package (0x01)  // _DEP: Dependencies
>>>              {
>>>                  ^SPI1.AUDI
>>>              })
>>>              Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
>>>              {
>>>                  PLPE
>>>              })
>>>              Method (_STA, 0, NotSerialized)  // _STA: Status
>>>              {
>>>                  If (LAnd (LEqual (LPEE, 0x02), LEqual (LPED, Zero)))
>>>                  {
>>>                      Return (0x0F)
>>>                  }
>>>
>>>                  Return (Zero)
>>>              }
>>>
>>> So how to bind the intel_sst_acpi with the WM5102 arizona coded and
>>> its hub named arizone ???
>>>
>>> Any suggestions or new directions?
>>
>> In your DSDT table, you need to leave the LPEA device alone. this is Intel only
>>
>> You will need to have a second device for your codec that is either a child of the I2C (or SPI?) controllers. This second device will have an HID that you need to include in the sst-acpi.c code. when the LPEA driver starts, it will look if this codec HID is present and if yes load the relevant machine driver and firmware.
>>
>> see for example the baytrail code, it uses the codec ID to identify which machine driver is needed. this is where you would need to add the wolfson HID.
>>
>> static struct sst_acpi_mach baytrail_machines[] = {
>>          { "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
>>          { "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
>>          {}
>> };
>>
>>
>> Maybe you can share your DSDT table (factory settings) if you want more help.
>> Also note that HIDs are specified based on rules defined by uefi.org, the "WM5102" does not follow any of the usual conventions. My guess is that the HID should be prefixed by the Wolfson PCI vendor ID.
>>
>>
>>> ....
>>>
>>>
>>> cheers
>>> chris
>>>
>>>
>>> 2015-05-19 15:39 GMT+02:00 Christian Hartmann <cornogle@googlemail.com>:
>>>> Hi,
>>>>
>>>> at the moment I am totally confused. I thought adding an ACPI ID is
>>>> trivial, but it is not.
>>>>
>>>> I have again a null pointer exception in arizona_spi_probe()
>>>>
>>>> could it be with the new num_chipselect value in spi-pxa2xx.c ??
>>>> I attach the trace of the last try
>>>>
>>>> Any hints or tips are welcome.
>>>>
>>>> cheers
>>>> chris
>>>>
>>>> 2015-05-19 11:04 GMT+02:00 Christian Hartmann <cornogle@googlemail.com>:
>>>>> Hi,
>>>>>
>>>>> so the ACPI id string, which I want to add to arizona-spi.c should be
>>>>>
>>>>> WM510205 ??
>>>>>
>>>>> I have changed the ACPI string to
>>>>>
>>>>> {"WM510205", WM5102},
>>>>>
>>>>> now and give it a try.
>>>>>
>>>>> cheers
>>>>> chris
>>>>>
>>>>> 2015-05-18 18:29 GMT+02:00 Pierre-Louis Bossart
>>>>> <pierre-louis.bossart@linux.intel.com>:
>>>>>> On 5/15/15 4:16 AM, Christian Hartmann wrote:
>>>>>>>
>>>>>>> Hi list,
>>>>>>>
>>>>>>>
>>>>>>> I need ACPI support for the arizona-core / arizona-spi driver for the
>>>>>>> ACPI ID WM5102.
>>>>>>> This audio codec is build into the Lenovo Yoga 851F. This device is a
>>>>>>> 32Bit (UEFI) system
>>>>>>>
>>>>>>>
>>>>>>> http://support.lenovo.com/de/de/products/tablets/yoga-series/yoga-tablet-2-851
>>>>>>>
>>>>>>>
>>>>>>> I have tested with vanilla kernels from kernel.org 3.19.y ,4.0.y and
>>>>>>> master (from torvalds) currently its 4.1.0-rc3. As distribution I am
>>>>>>> working with Fedora / Fedlet was the initial install image.
>>>>>>>
>>>>>>> With all vanilla kernels I got at first an error message from spi32766:
>>>>>>>
>>>>>>> [ 0.296297] pxa2xx-spi 80860F0E:00: cs1 >= max 1
>>>>>>> [ 0.296311] spi_master spi32766: failed to add SPI device
>>>>>>> WM510205:00 from ACPI
>>>>>>>
>>>>>>> so I have at first patched as suggested by broonie the arizona-core
>>>>>>>
>>>>>>> commit 48203a0fede057d6a8c5f6872c53326395350f45
>>>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>>>> Date:   Mon May 11 13:35:43 2015 +0200
>>>>>>>
>>>>>>>       spi-pxa2xx : raise chipselect
>>>>>>>
>>>>>>>       Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>>>
>>>>>>> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
>>>>>>> index e3223ac..9c919ea 100644
>>>>>>> --- a/drivers/spi/spi-pxa2xx.c
>>>>>>> +++ b/drivers/spi/spi-pxa2xx.c
>>>>>>> @@ -1279,7 +1279,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device
>>>>>>> *pdev)
>>>>>>>           if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0,
>>>>>>> &devid))
>>>>>>>                   ssp->port_id = devid;
>>>>>>>
>>>>>>> -       pdata->num_chipselect = 1;
>>>>>>> +       pdata->num_chipselect = 20;
>>>>>>>           pdata->enable_dma = true;
>>>>>>>
>>>>>>>           return pdata;
>>>>>>>
>>>>>>> This leds the spi master do the further ACPI configuration and inital
>>>>>>> setup for the arizona-spi device, but adding the ACPI ID to it
>>>>>>> does not work yet as expected:
>>>>>>>
>>>>>>> The current last patchset on top of master is
>>>>>>>
>>>>>>>
>>>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>>>> Date:   Wed May 13 11:36:25 2015 +0200
>>>>>>>
>>>>>>>       arizona : added ACPI id of wm5102 to SPI driver, too
>>>>>>>
>>>>>>>       Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>>>
>>>>>>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>>>>>>> index 1e845f6..c19a4c1 100644
>>>>>>> --- a/drivers/mfd/arizona-spi.c
>>>>>>> +++ b/drivers/mfd/arizona-spi.c
>>>>>>> @@ -17,6 +17,7 @@
>>>>>>>    #include <linux/regulator/consumer.h>
>>>>>>>    #include <linux/slab.h>
>>>>>>>    #include <linux/spi/spi.h>
>>>>>>> +#include <linux/acpi.h>
>>>>>>>    #include <linux/of.h>
>>>>>>>
>>>>>>>    #include <linux/mfd/arizona/core.h>
>>>>>>> @@ -82,6 +83,15 @@ static int arizona_spi_remove(struct spi_device *spi)
>>>>>>>           return 0;
>>>>>>>    }
>>>>>>>
>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>>>>> +               { "WM5102", 0},
>>>>>>> +               { "WM510205", 0},
>>>>>>> +               { },
>>>>>>> +};
>>>>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>>>>> +#endif
>>>>>>> +
>>>>>>>    static const struct spi_device_id arizona_spi_ids[] = {
>>>>>>>           { "wm5102", WM5102 },
>>>>>>>           { "wm5110", WM5110 },
>>>>>>> @@ -96,6 +106,9 @@ static struct spi_driver arizona_spi_driver = {
>>>>>>>                   .owner  = THIS_MODULE,
>>>>>>>                   .pm     = &arizona_pm_ops,
>>>>>>>                   .of_match_table = of_match_ptr(arizona_of_match),
>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>>>>> +#endif
>>>>>>>           },
>>>>>>>           .probe          = arizona_spi_probe,
>>>>>>>           .remove         = arizona_spi_remove,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> commit 268e21d29c942205e40f749c6d71c77839dc67da
>>>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>>>> Date:   Wed May 13 11:36:04 2015 +0200
>>>>>>>
>>>>>>>       arizona : added ACPI id of wm5102 to i2c driver
>>>>>>>
>>>>>>>       Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>>>
>>>>>>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>>>>>>> index ff782a5..45ece1b 100644
>>>>>>> --- a/drivers/mfd/arizona-i2c.c
>>>>>>> +++ b/drivers/mfd/arizona-i2c.c
>>>>>>> @@ -18,6 +18,7 @@
>>>>>>>    #include <linux/regulator/consumer.h>
>>>>>>>    #include <linux/slab.h>
>>>>>>>    #include <linux/of.h>
>>>>>>> +#include <linux/acpi.h>
>>>>>>>
>>>>>>>    #include <linux/mfd/arizona/core.h>
>>>>>>>
>>>>>>> @@ -85,6 +86,15 @@ static int arizona_i2c_remove(struct i2c_client *i2c)
>>>>>>>           return 0;
>>>>>>>    }
>>>>>>>
>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>>>>> +               { "WM5102", 0},
>>>>>>> +               { "WM510205", 0},
>>>>>>> +               { },
>>>>>>
>>>>>>
>>>>>> Those IDs don't really look like ACPI ones? Isn't there a rule that the _HID
>>>>>> is represented by a 4-letter vendor ID followed by part ID? see
>>>>>> http://www.uefi.org/PNP_ACPI_Registry
>>>>>>
>>>>>>
>>>>>>> +};
>>>>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>>>>> +#endif
>>>>>>> +
>>>>>>>    static const struct i2c_device_id arizona_i2c_id[] = {
>>>>>>>           { "wm5102", WM5102 },
>>>>>>>           { "wm5110", WM5110 },
>>>>>>> @@ -100,6 +110,9 @@ static struct i2c_driver arizona_i2c_driver = {
>>>>>>>                   .owner  = THIS_MODULE,
>>>>>>>                   .pm     = &arizona_pm_ops,
>>>>>>>                   .of_match_table = of_match_ptr(arizona_of_match),
>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>>>>> +#endif
>>>>>>>           },
>>>>>>>           .probe          = arizona_i2c_probe,
>>>>>>>           .remove         = arizona_i2c_remove,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> with these two patches the local master branch compiles fine, but at
>>>>>>> initialzing the arizona-spi driver gots a NULL pointer exception.
>>>>>>>
>>>>>>> I attach the whole dmesg of 4.1.0-rc3 (build 4.1.0.24-rc3).
>>>>>>>
>>>>>>> I need some assistance or hints to the right direction, I am looking
>>>>>>> myself and I also try what I can, but I think it would be easy peasy
>>>>>>> with some experts like here on this list :)
>>>>>>>
>>>>>>>
>>>>>>> PS: the message : spi_master spi32766: raised num_chipselect to 20 for
>>>>>>> WM510205:00
>>>>>>>
>>>>>>> is a dev_err() line added to the function static acpi_status
>>>>>>> acpi_spi_add_device(), there I had raised the num_chipselect first
>>>>>>> (that was wrong, the raise is now done as in the first patch above.
>>>>>>> this is only a debug message and will be removed soon)
>>>>>>>
>>>>>>>
>>>>>>> PPS: for me it seems that there is a missing 'link' from WM5102 to the
>>>>>>> sst-acpi 80860F28:00 device, which complaints NOW / the first time
>>>>>>> with the three patches applied on top on master.... will have a look
>>>>>>> into it.
>>>>>>>
>>>>>>> I hope I got this device working with some more help from you.
>>>>>>>
>>>>>>> cheers
>>>>>>> chris
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Alsa-devel mailing list
>>>>>>> Alsa-devel@alsa-project.org
>>>>>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>>>>>
>>>>>
>>> _______________________________________________
>>> Alsa-devel mailing list
>>> Alsa-devel@alsa-project.org
>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>
>>
>
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [WM5102/ARIZONA] spi driver needs to support ACPI
  2015-06-03 14:59             ` Pierre-Louis Bossart
@ 2015-06-04  7:23               ` Christian Hartmann
  2015-06-04 14:57                 ` Pierre-Louis Bossart
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Hartmann @ 2015-06-04  7:23 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 15029 bytes --]

hi,

her is the dsdt.dsl in readable format (looks better)


2015-06-03 16:59 GMT+02:00 Pierre-Louis Bossart
<pierre-louis.bossart@linux.intel.com>:
> On 6/3/15 2:50 AM, Christian Hartmann wrote:
>>
>> hi,
>>
>> thanks Pierre-Luis,
>>
>> I attach the DSDT table in ASM format to get this device working as
>> soon as possible.
>
>
> this format is unreadable, can you extract the plain DSL instead, e.g. with
> iasl -d dsdt.dat -> extracts dsdt.dsl with only the code in 'human-readable'
> format.
>
>
>>
>> By the way, I looked yesterday into the baytrail code (sound/soc/intel/sst
>> )
>> and I added this WM510205 codec.... but I do not know if I have it
>> done correctly... currently I test my latest changes, seems to not
>> work as expected yet.
>>
>>
>> cheers
>> chris
>>
>>
>> 2015-06-02 20:13 GMT+02:00 Pierre-Louis Bossart
>> <pierre-louis.bossart@linux.intel.com>:
>>>
>>> On 06/02/2015 03:34 AM, Christian Hartmann wrote:
>>>>
>>>> hi list again,
>>>>
>>>> I have patched the torvalds/master branch currently rc6
>>>> and I have no NULL pointer exception anymore.
>>>>
>>>> I will send each patch separately
>>>>
>>>> Of course no (working) soundcard yet..
>>>>
>>>> so let be try to describe what is actually open or resolved for me:
>>>>
>>>> * the spi master 37622 (pxa2xx) does not fail to add the SPI slave
>>>> spi-WM510205
>>>> pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00
>>>>
>>>> * ALSA device list: no soundcards found
>>>> * in dmesg I found two message indicating that something seems to be
>>>> missing yet:
>>>>
>>>> sst-acpi 80860F28:00: No matching ASoC machine driver found
>>>> intel-sst-acpi 80860F28:00: No matching machine driver found
>>>>
>>>>
>>>> snip of dmesg 4.1.0.42-rc6
>>>>
>>>>
>>>> [    6.075170] sst-acpi 80860F28:00: No matching ASoC machine driver
>>>> found
>>>> [    6.106787] pxa2xx-spi 80860F0E:00: no DMA channels available, using
>>>> PIO
>>>> [    6.106865] pxa2xx-spi 80860F0E:00: registered master spi32766
>>>> (dynamic)
>>>> [    6.107058] spi spi-WM510205:00: 8333333 Hz actual, PIO
>>>> [    6.107065] spi spi-WM510205:00: setup mode 0, 8 bits/w, 8000000 Hz
>>>> max --> 0
>>>> [    6.107151] pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00
>>>> [    6.114510] rfkill_gpio LNV4752:00: GPIO lookup for consumer reset
>>>> [    6.114519] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
>>>> [    6.114526] acpi LNV4752:00: GPIO: looking up reset-gpios
>>>> [    6.114533] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 0 0 0
>>>> [    6.114607] no flags found for reset
>>>> [    6.114619] rfkill_gpio LNV4752:00: GPIO lookup for consumer shutdown
>>>> [    6.114623] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
>>>> [    6.114628] acpi LNV4752:00: GPIO: looking up shutdown-gpios
>>>> [    6.114633] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 1 0 0
>>>> [    6.114669] acpi LNV4752:00: GPIO: looking up shutdown-gpio
>>>> [    6.114675] acpi LNV4752:00: GPIO: looking up 0 in _CRS
>>>> [    6.114711] gpio-411 (reset): gpiod_request: status -16
>>>> [    6.114849] rfkill_gpio LNV4752:00: LNV4752:00 device registered.
>>>> [    6.247784] intel_sst_acpi 80860F28:00: No matching machine driver
>>>> found
>>>>
>>>>
>>>> I have grepped the string 80860F28 in the ACPI DSDT table (->
>>>> dsdt.dsl) and found
>>>>
>>>>      {
>>>>          Device (LPEA)
>>>>          {
>>>>              Name (_ADR, Zero)  // _ADR: Address
>>>>              Name (_HID, "80860F28" /* Intel SST Audio DSP */)  //
>>>> _HID: Hardware ID
>>>>              Name (_CID, "80860F28" /* Intel SST Audio DSP */)  //
>>>> _CID: Compatible ID
>>>>              Name (_DDN, "Intel(R) Low Power Audio Controller -
>>>> 80860F28")  // _DDN: DOS Device Name
>>>>              Name (_SUB, "17AA7004")  // _SUB: Subsystem ID
>>>>              Name (_UID, One)  // _UID: Unique ID
>>>>              Name (_DEP, Package (0x01)  // _DEP: Dependencies
>>>>              {
>>>>                  ^SPI1.AUDI
>>>>              })
>>>>              Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
>>>>              {
>>>>                  PLPE
>>>>              })
>>>>              Method (_STA, 0, NotSerialized)  // _STA: Status
>>>>              {
>>>>                  If (LAnd (LEqual (LPEE, 0x02), LEqual (LPED, Zero)))
>>>>                  {
>>>>                      Return (0x0F)
>>>>                  }
>>>>
>>>>                  Return (Zero)
>>>>              }
>>>>
>>>> So how to bind the intel_sst_acpi with the WM5102 arizona coded and
>>>> its hub named arizone ???
>>>>
>>>> Any suggestions or new directions?
>>>
>>>
>>> In your DSDT table, you need to leave the LPEA device alone. this is
>>> Intel only
>>>
>>> You will need to have a second device for your codec that is either a
>>> child of the I2C (or SPI?) controllers. This second device will have an HID
>>> that you need to include in the sst-acpi.c code. when the LPEA driver
>>> starts, it will look if this codec HID is present and if yes load the
>>> relevant machine driver and firmware.
>>>
>>> see for example the baytrail code, it uses the codec ID to identify which
>>> machine driver is needed. this is where you would need to add the wolfson
>>> HID.
>>>
>>> static struct sst_acpi_mach baytrail_machines[] = {
>>>          { "10EC5640", "byt-rt5640",
>>> "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
>>>          { "193C9890", "byt-max98090",
>>> "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
>>>          {}
>>> };
>>>
>>>
>>> Maybe you can share your DSDT table (factory settings) if you want more
>>> help.
>>> Also note that HIDs are specified based on rules defined by uefi.org, the
>>> "WM5102" does not follow any of the usual conventions. My guess is that the
>>> HID should be prefixed by the Wolfson PCI vendor ID.
>>>
>>>
>>>> ....
>>>>
>>>>
>>>> cheers
>>>> chris
>>>>
>>>>
>>>> 2015-05-19 15:39 GMT+02:00 Christian Hartmann <cornogle@googlemail.com>:
>>>>>
>>>>> Hi,
>>>>>
>>>>> at the moment I am totally confused. I thought adding an ACPI ID is
>>>>> trivial, but it is not.
>>>>>
>>>>> I have again a null pointer exception in arizona_spi_probe()
>>>>>
>>>>> could it be with the new num_chipselect value in spi-pxa2xx.c ??
>>>>> I attach the trace of the last try
>>>>>
>>>>> Any hints or tips are welcome.
>>>>>
>>>>> cheers
>>>>> chris
>>>>>
>>>>> 2015-05-19 11:04 GMT+02:00 Christian Hartmann
>>>>> <cornogle@googlemail.com>:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> so the ACPI id string, which I want to add to arizona-spi.c should be
>>>>>>
>>>>>> WM510205 ??
>>>>>>
>>>>>> I have changed the ACPI string to
>>>>>>
>>>>>> {"WM510205", WM5102},
>>>>>>
>>>>>> now and give it a try.
>>>>>>
>>>>>> cheers
>>>>>> chris
>>>>>>
>>>>>> 2015-05-18 18:29 GMT+02:00 Pierre-Louis Bossart
>>>>>> <pierre-louis.bossart@linux.intel.com>:
>>>>>>>
>>>>>>> On 5/15/15 4:16 AM, Christian Hartmann wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> Hi list,
>>>>>>>>
>>>>>>>>
>>>>>>>> I need ACPI support for the arizona-core / arizona-spi driver for
>>>>>>>> the
>>>>>>>> ACPI ID WM5102.
>>>>>>>> This audio codec is build into the Lenovo Yoga 851F. This device is
>>>>>>>> a
>>>>>>>> 32Bit (UEFI) system
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://support.lenovo.com/de/de/products/tablets/yoga-series/yoga-tablet-2-851
>>>>>>>>
>>>>>>>>
>>>>>>>> I have tested with vanilla kernels from kernel.org 3.19.y ,4.0.y and
>>>>>>>> master (from torvalds) currently its 4.1.0-rc3. As distribution I am
>>>>>>>> working with Fedora / Fedlet was the initial install image.
>>>>>>>>
>>>>>>>> With all vanilla kernels I got at first an error message from
>>>>>>>> spi32766:
>>>>>>>>
>>>>>>>> [ 0.296297] pxa2xx-spi 80860F0E:00: cs1 >= max 1
>>>>>>>> [ 0.296311] spi_master spi32766: failed to add SPI device
>>>>>>>> WM510205:00 from ACPI
>>>>>>>>
>>>>>>>> so I have at first patched as suggested by broonie the arizona-core
>>>>>>>>
>>>>>>>> commit 48203a0fede057d6a8c5f6872c53326395350f45
>>>>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>>>>> Date:   Mon May 11 13:35:43 2015 +0200
>>>>>>>>
>>>>>>>>       spi-pxa2xx : raise chipselect
>>>>>>>>
>>>>>>>>       Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>>>>
>>>>>>>> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
>>>>>>>> index e3223ac..9c919ea 100644
>>>>>>>> --- a/drivers/spi/spi-pxa2xx.c
>>>>>>>> +++ b/drivers/spi/spi-pxa2xx.c
>>>>>>>> @@ -1279,7 +1279,7 @@ pxa2xx_spi_acpi_get_pdata(struct
>>>>>>>> platform_device
>>>>>>>> *pdev)
>>>>>>>>           if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id,
>>>>>>>> 0,
>>>>>>>> &devid))
>>>>>>>>                   ssp->port_id = devid;
>>>>>>>>
>>>>>>>> -       pdata->num_chipselect = 1;
>>>>>>>> +       pdata->num_chipselect = 20;
>>>>>>>>           pdata->enable_dma = true;
>>>>>>>>
>>>>>>>>           return pdata;
>>>>>>>>
>>>>>>>> This leds the spi master do the further ACPI configuration and
>>>>>>>> inital
>>>>>>>> setup for the arizona-spi device, but adding the ACPI ID to it
>>>>>>>> does not work yet as expected:
>>>>>>>>
>>>>>>>> The current last patchset on top of master is
>>>>>>>>
>>>>>>>>
>>>>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>>>>> Date:   Wed May 13 11:36:25 2015 +0200
>>>>>>>>
>>>>>>>>       arizona : added ACPI id of wm5102 to SPI driver, too
>>>>>>>>
>>>>>>>>       Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>>>>
>>>>>>>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>>>>>>>> index 1e845f6..c19a4c1 100644
>>>>>>>> --- a/drivers/mfd/arizona-spi.c
>>>>>>>> +++ b/drivers/mfd/arizona-spi.c
>>>>>>>> @@ -17,6 +17,7 @@
>>>>>>>>    #include <linux/regulator/consumer.h>
>>>>>>>>    #include <linux/slab.h>
>>>>>>>>    #include <linux/spi/spi.h>
>>>>>>>> +#include <linux/acpi.h>
>>>>>>>>    #include <linux/of.h>
>>>>>>>>
>>>>>>>>    #include <linux/mfd/arizona/core.h>
>>>>>>>> @@ -82,6 +83,15 @@ static int arizona_spi_remove(struct spi_device
>>>>>>>> *spi)
>>>>>>>>           return 0;
>>>>>>>>    }
>>>>>>>>
>>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>>>>>> +               { "WM5102", 0},
>>>>>>>> +               { "WM510205", 0},
>>>>>>>> +               { },
>>>>>>>> +};
>>>>>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>>>>>> +#endif
>>>>>>>> +
>>>>>>>>    static const struct spi_device_id arizona_spi_ids[] = {
>>>>>>>>           { "wm5102", WM5102 },
>>>>>>>>           { "wm5110", WM5110 },
>>>>>>>> @@ -96,6 +106,9 @@ static struct spi_driver arizona_spi_driver = {
>>>>>>>>                   .owner  = THIS_MODULE,
>>>>>>>>                   .pm     = &arizona_pm_ops,
>>>>>>>>                   .of_match_table = of_match_ptr(arizona_of_match),
>>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>>>>>> +#endif
>>>>>>>>           },
>>>>>>>>           .probe          = arizona_spi_probe,
>>>>>>>>           .remove         = arizona_spi_remove,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> commit 268e21d29c942205e40f749c6d71c77839dc67da
>>>>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>>>>> Date:   Wed May 13 11:36:04 2015 +0200
>>>>>>>>
>>>>>>>>       arizona : added ACPI id of wm5102 to i2c driver
>>>>>>>>
>>>>>>>>       Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>>>>
>>>>>>>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>>>>>>>> index ff782a5..45ece1b 100644
>>>>>>>> --- a/drivers/mfd/arizona-i2c.c
>>>>>>>> +++ b/drivers/mfd/arizona-i2c.c
>>>>>>>> @@ -18,6 +18,7 @@
>>>>>>>>    #include <linux/regulator/consumer.h>
>>>>>>>>    #include <linux/slab.h>
>>>>>>>>    #include <linux/of.h>
>>>>>>>> +#include <linux/acpi.h>
>>>>>>>>
>>>>>>>>    #include <linux/mfd/arizona/core.h>
>>>>>>>>
>>>>>>>> @@ -85,6 +86,15 @@ static int arizona_i2c_remove(struct i2c_client
>>>>>>>> *i2c)
>>>>>>>>           return 0;
>>>>>>>>    }
>>>>>>>>
>>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>>>>>> +               { "WM5102", 0},
>>>>>>>> +               { "WM510205", 0},
>>>>>>>> +               { },
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Those IDs don't really look like ACPI ones? Isn't there a rule that
>>>>>>> the _HID
>>>>>>> is represented by a 4-letter vendor ID followed by part ID? see
>>>>>>> http://www.uefi.org/PNP_ACPI_Registry
>>>>>>>
>>>>>>>
>>>>>>>> +};
>>>>>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>>>>>> +#endif
>>>>>>>> +
>>>>>>>>    static const struct i2c_device_id arizona_i2c_id[] = {
>>>>>>>>           { "wm5102", WM5102 },
>>>>>>>>           { "wm5110", WM5110 },
>>>>>>>> @@ -100,6 +110,9 @@ static struct i2c_driver arizona_i2c_driver = {
>>>>>>>>                   .owner  = THIS_MODULE,
>>>>>>>>                   .pm     = &arizona_pm_ops,
>>>>>>>>                   .of_match_table = of_match_ptr(arizona_of_match),
>>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>>>>>> +#endif
>>>>>>>>           },
>>>>>>>>           .probe          = arizona_i2c_probe,
>>>>>>>>           .remove         = arizona_i2c_remove,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> with these two patches the local master branch compiles fine, but at
>>>>>>>> initialzing the arizona-spi driver gots a NULL pointer exception.
>>>>>>>>
>>>>>>>> I attach the whole dmesg of 4.1.0-rc3 (build 4.1.0.24-rc3).
>>>>>>>>
>>>>>>>> I need some assistance or hints to the right direction, I am looking
>>>>>>>> myself and I also try what I can, but I think it would be easy peasy
>>>>>>>> with some experts like here on this list :)
>>>>>>>>
>>>>>>>>
>>>>>>>> PS: the message : spi_master spi32766: raised num_chipselect to 20
>>>>>>>> for
>>>>>>>> WM510205:00
>>>>>>>>
>>>>>>>> is a dev_err() line added to the function static acpi_status
>>>>>>>> acpi_spi_add_device(), there I had raised the num_chipselect first
>>>>>>>> (that was wrong, the raise is now done as in the first patch above.
>>>>>>>> this is only a debug message and will be removed soon)
>>>>>>>>
>>>>>>>>
>>>>>>>> PPS: for me it seems that there is a missing 'link' from WM5102 to
>>>>>>>> the
>>>>>>>> sst-acpi 80860F28:00 device, which complaints NOW / the first time
>>>>>>>> with the three patches applied on top on master.... will have a look
>>>>>>>> into it.
>>>>>>>>
>>>>>>>> I hope I got this device working with some more help from you.
>>>>>>>>
>>>>>>>> cheers
>>>>>>>> chris
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Alsa-devel mailing list
>>>>>>>> Alsa-devel@alsa-project.org
>>>>>>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>>>>>>
>>>>>>
>>>> _______________________________________________
>>>> Alsa-devel mailing list
>>>> Alsa-devel@alsa-project.org
>>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>>
>>>
>>
>>
>>
>



-- 
--
......oooO..............
.....(....).....Oooo...
......)../.....(....)....
.....(_/.......)../.....
...............(_/.......
... I WAS ..............
.......... HERE...... ;)

[-- Attachment #2: dsdt.dsl --]
[-- Type: text/x-dsl, Size: 379479 bytes --]

/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20150410-32
 * Copyright (c) 2000 - 2015 Intel Corporation
 * 
 * Disassembling to symbolic ASL+ operators
 *
 * Disassembly of dsdt.dat, Tue May 19 11:27:28 2015
 *
 * Original Table Header:
 *     Signature        "DSDT"
 *     Length           0x0000A6B5 (42677)
 *     Revision         0x02
 *     Checksum         0xE6
 *     OEM ID           "LENOVO"
 *     OEM Table ID     "CS-02   "
 *     OEM Revision     0x00000001 (1)
 *     Compiler ID      "ACPI"
 *     Compiler Version 0x00040000 (262144)
 */
DefinitionBlock ("dsdt.aml", "DSDT", 2, "LENOVO", "CS-02   ", 0x00000001)
{
    /*
     * iASL Warning: There were 2 external control methods found during
     * disassembly, but additional ACPI tables to resolve these externals
     * were not specified. This resulting disassembler output file may not
     * compile because the disassembler did not know how many arguments
     * to assign to these methods. To specify the tables needed to resolve
     * external control method references, the -e option can be used to
     * specify the filenames. Example iASL invocations:
     *     iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml
     *     iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml
     *     iasl -e ssdt*.aml -d dsdt.aml
     *
     * In addition, the -fe option can be used to specify a file containing
     * control method external declarations with the associated method
     * argument counts. Each line of the file must be of the form:
     *     External (<method pathname>, MethodObj, <argument count>)
     * Invocation:
     *     iasl -fe refs.txt -d dsdt.aml
     *
     * The following methods were unresolved and many not compile properly
     * because the disassembler had to guess at the number of arguments
     * required for each:
     */
    External (_SB_.PCI0.LPCB.TPM_.PTS_, MethodObj)    // Warning: Unresolved method, guessing 1 arguments
    External (NDN3, MethodObj)    // Warning: Unresolved method, guessing 1 arguments

    External (_PR_.CPU0._PPC, UnknownObj)
    External (CFGD, UnknownObj)
    External (DPTF, UnknownObj)
    External (PDC0, UnknownObj)
    External (PDC1, UnknownObj)
    External (PDC2, UnknownObj)
    External (PDC3, UnknownObj)
    External (STR3, UnknownObj)
    External (TCHG, UnknownObj)

    Method (ADBG, 1, Serialized)
    {
        Return (Zero)
    }

    Name (SP3O, 0x2E)
    Name (IO4B, 0x0A20)
    Name (IO4L, 0x20)
    Name (SP1O, 0x4E)
    Name (PMBS, 0x0400)
    Name (SMIP, 0xB2)
    Name (GPBS, 0x0500)
    Name (APCB, 0xFEC00000)
    Name (APCL, 0x1000)
    Name (PFDR, 0xFED03034)
    Name (PMCB, 0xFED03000)
    Name (PCLK, 0xFED03060)
    Name (PUNB, 0xFED05000)
    Name (IBAS, 0xFED08000)
    Name (SRCB, 0xFED1C000)
    Name (SRCL, 0x1000)
    Name (HPTB, 0xFED00000)
    Name (MCHB, 0xFED14000)
    Name (MCHL, 0x4000)
    Name (EGPB, 0xFED19000)
    Name (EGPL, 0x1000)
    Name (DMIB, 0xFED18000)
    Name (DMIL, 0x1000)
    Name (IFPB, 0xFED14000)
    Name (IFPL, 0x1000)
    Name (PEBS, 0xE0000000)
    Name (PELN, 0x10000000)
    Name (FMBL, One)
    Name (FDTP, 0x02)
    Name (GCDD, One)
    Name (DSTA, 0x0A)
    Name (DSLO, 0x02)
    Name (DSLC, 0x03)
    Name (PITS, 0x10)
    Name (SBCS, 0x12)
    Name (SALS, 0x13)
    Name (LSSS, 0x2A)
    Name (PSSS, 0x67)
    Name (SOOT, 0x35)
    Name (ESCS, 0x6A)
    Name (SDGV, 0x1C)
    Name (ACPH, 0xDE)
    Name (ASSB, Zero)
    Name (AOTB, Zero)
    Name (AAXB, Zero)
    Name (PEHP, One)
    Name (SHPC, Zero)
    Name (PEPM, One)
    Name (PEER, One)
    Name (PECS, One)
    Name (ITKE, Zero)
    Name (FTBL, 0x04)
    OperationRegion (GNVS, SystemMemory, 0x78C89A90, 0x0340)
    Field (GNVS, AnyAcc, Lock, Preserve)
    {
        OSYS,   16, 
        SMIF,   8, 
        PRM0,   8, 
        PRM1,   8, 
        SCIF,   8, 
        PRM2,   8, 
        PRM3,   8, 
        LCKF,   8, 
        PRM4,   8, 
        PRM5,   8, 
        P80D,   32, 
        LIDS,   8, 
        PWRS,   8, 
        DBGS,   8, 
        THOF,   8, 
        Offset (0x15), 
        PSVT,   8, 
        TC1V,   8, 
        TC2V,   8, 
        TSPV,   8, 
        CRTT,   8, 
        DTSE,   8, 
        DTS1,   8, 
        DTS2,   8, 
        DTSF,   8, 
        BNUM,   8, 
        B0SC,   8, 
        B1SC,   8, 
        B2SC,   8, 
        B0SS,   8, 
        B1SS,   8, 
        B2SS,   8, 
        Offset (0x28), 
        APIC,   8, 
        MPEN,   8, 
        PCP0,   8, 
        PCP1,   8, 
        PPCM,   8, 
        PPMF,   32, 
        Offset (0x32), 
        NATP,   8, 
        CMAP,   8, 
        CMBP,   8, 
        LPTP,   8, 
        FDCP,   8, 
        CMCP,   8, 
        CIRP,   8, 
        W381,   8, 
        NPCE,   8, 
        Offset (0x3C), 
        IGDS,   8, 
        TLST,   8, 
        CADL,   8, 
        PADL,   8, 
        CSTE,   16, 
        NSTE,   16, 
        SSTE,   16, 
        NDID,   8, 
        DID1,   32, 
        DID2,   32, 
        DID3,   32, 
        DID4,   32, 
        DID5,   32, 
        KSV0,   32, 
        KSV1,   8, 
        Offset (0x67), 
        BLCS,   8, 
        BRTL,   8, 
        ALSE,   8, 
        ALAF,   8, 
        LLOW,   8, 
        LHIH,   8, 
        Offset (0x6E), 
        EMAE,   8, 
        EMAP,   16, 
        EMAL,   16, 
        Offset (0x74), 
        MEFE,   8, 
        DSTS,   8, 
        Offset (0x78), 
        TPMP,   8, 
        TPME,   8, 
        MORD,   8, 
        TCGP,   8, 
        PPRP,   32, 
        PPRQ,   8, 
        LPPR,   8, 
        GTF0,   56, 
        GTF2,   56, 
        IDEM,   8, 
        GTF1,   56, 
        Offset (0xA0), 
        Offset (0xAA), 
        ASLB,   32, 
        IBTT,   8, 
        IPAT,   8, 
        ITVF,   8, 
        ITVM,   8, 
        IPSC,   8, 
        IBLC,   8, 
        IBIA,   8, 
        ISSC,   8, 
        I409,   8, 
        I509,   8, 
        I609,   8, 
        I709,   8, 
        IDMM,   8, 
        IDMS,   8, 
        IF1E,   8, 
        HVCO,   8, 
        NXD1,   32, 
        NXD2,   32, 
        NXD3,   32, 
        NXD4,   32, 
        NXD5,   32, 
        NXD6,   32, 
        NXD7,   32, 
        NXD8,   32, 
        GSMI,   8, 
        PAVP,   8, 
        Offset (0xE1), 
        OSCC,   8, 
        NEXP,   8, 
        Offset (0xE4), 
        Offset (0xE5), 
        Offset (0xEB), 
        DSEN,   8, 
        ECON,   8, 
        GPIC,   8, 
        CTYP,   8, 
        L01C,   8, 
        VFN0,   8, 
        VFN1,   8, 
        Offset (0x100), 
        NVGA,   32, 
        NVHA,   32, 
        AMDA,   32, 
        DID6,   32, 
        DID7,   32, 
        DID8,   32, 
        Offset (0x11C), 
        Offset (0x120), 
        Offset (0x124), 
        Offset (0x128), 
        Offset (0x12C), 
        Offset (0x130), 
        Offset (0x134), 
        Offset (0x138), 
        Offset (0x13C), 
        Offset (0x140), 
        Offset (0x144), 
        Offset (0x148), 
        Offset (0x14C), 
        USEL,   8, 
        PU1E,   8, 
        PU2E,   8, 
        LPE0,   32, 
        LPE1,   32, 
        LPE2,   32, 
        ACST,   8, 
        BTST,   8, 
        PFLV,   8, 
        Offset (0x15F), 
        AOAC,   8, 
        XHCI,   8, 
        PMEN,   8, 
        LPEE,   8, 
        ISPA,   32, 
        ISPD,   8, 
        PCIB,   32, 
        PCIT,   32, 
        D10A,   32, 
        D10L,   32, 
        D11A,   32, 
        D11L,   32, 
        P10A,   32, 
        P10L,   32, 
        P11A,   32, 
        P11L,   32, 
        P20A,   32, 
        P20L,   32, 
        P21A,   32, 
        P21L,   32, 
        U10A,   32, 
        U10L,   32, 
        U11A,   32, 
        U11L,   32, 
        U20A,   32, 
        U20L,   32, 
        U21A,   32, 
        U21L,   32, 
        SP0A,   32, 
        SP0L,   32, 
        SP1A,   32, 
        SP1L,   32, 
        D20A,   32, 
        D20L,   32, 
        D21A,   32, 
        D21L,   32, 
        I10A,   32, 
        I10L,   32, 
        I11A,   32, 
        I11L,   32, 
        I20A,   32, 
        I20L,   32, 
        I21A,   32, 
        I21L,   32, 
        I30A,   32, 
        I30L,   32, 
        I31A,   32, 
        I31L,   32, 
        I40A,   32, 
        I40L,   32, 
        I41A,   32, 
        I41L,   32, 
        I50A,   32, 
        I50L,   32, 
        I51A,   32, 
        I51L,   32, 
        I60A,   32, 
        I60L,   32, 
        I61A,   32, 
        I61L,   32, 
        I70A,   32, 
        I70L,   32, 
        I71A,   32, 
        I71L,   32, 
        EM0A,   32, 
        EM0L,   32, 
        EM1A,   32, 
        EM1L,   32, 
        SI0A,   32, 
        SI0L,   32, 
        SI1A,   32, 
        SI1L,   32, 
        SD0A,   32, 
        SD0L,   32, 
        SD1A,   32, 
        SD1L,   32, 
        MH0A,   32, 
        MH0L,   32, 
        MH1A,   32, 
        MH1L,   32, 
        OSSL,   8, 
        Offset (0x294), 
        DPTE,   8, 
        THM0,   8, 
        THM1,   8, 
        THM2,   8, 
        THM3,   8, 
        THM4,   8, 
        CHGR,   8, 
        DDSP,   8, 
        DSOC,   8, 
        DPSR,   8, 
        DPCT,   32, 
        DPPT,   32, 
        DGC0,   32, 
        DGP0,   32, 
        DGC1,   32, 
        DGP1,   32, 
        DGC2,   32, 
        DGP2,   32, 
        DGC3,   32, 
        DGP3,   32, 
        DGC4,   32, 
        DGP4,   32, 
        DLPM,   8, 
        DSC0,   32, 
        DSC1,   32, 
        DSC2,   32, 
        DSC3,   32, 
        DSC4,   32, 
        DDBG,   8, 
        LPOE,   32, 
        LPPS,   32, 
        LPST,   32, 
        LPPC,   32, 
        LPPF,   32, 
        DPME,   8, 
        BCSL,   8, 
        NFCS,   8, 
        Offset (0x2FC), 
        TPMA,   32, 
        TPML,   32, 
        ITSA,   8, 
        S0IX,   8, 
        SDMD,   8, 
        EMVR,   8, 
        BMBD,   32, 
        FSAS,   8, 
        BDID,   8, 
        FBID,   8, 
        OTGM,   8, 
        STEP,   8, 
        SOCS,   8, 
        AMTE,   8, 
        SCPE,   8, 
        SARE,   8, 
        PSSD,   8, 
        EDPV,   8, 
        DIDX,   32
    }

    Scope (_SB)
    {
        Device (RTC)
        {
            Name (_HID, EisaId ("PNP0B00") /* AT Real-Time Clock */)  // _HID: Hardware ID
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                IO (Decode16,
                    0x0070,             // Range Minimum
                    0x0070,             // Range Maximum
                    0x01,               // Alignment
                    0x08,               // Length
                    )
            })
        }

        Device (HPET)
        {
            Name (_HID, EisaId ("PNP0103") /* HPET System Timer */)  // _HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
            {
                Name (RBUF, ResourceTemplate ()
                {
                    Memory32Fixed (ReadWrite,
                        0xFED00000,         // Address Base
                        0x00000400,         // Address Length
                        )
                    Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                    {
                        0x00000008,
                    }
                })
                Return (RBUF) /* \_SB_.HPET._CRS.RBUF */
            }
        }

        Name (PR00, Package (0x12)
        {
            Package (0x04)
            {
                0x0010FFFF, 
                Zero, 
                LNKA, 
                Zero
            }, 

            Package (0x04)
            {
                0x0011FFFF, 
                Zero, 
                LNKB, 
                Zero
            }, 

            Package (0x04)
            {
                0x0012FFFF, 
                Zero, 
                LNKC, 
                Zero
            }, 

            Package (0x04)
            {
                0x0014FFFF, 
                Zero, 
                LNKE, 
                Zero
            }, 

            Package (0x04)
            {
                0x0015FFFF, 
                Zero, 
                LNKF, 
                Zero
            }, 

            Package (0x04)
            {
                0x0016FFFF, 
                Zero, 
                LNKG, 
                Zero
            }, 

            Package (0x04)
            {
                0x0017FFFF, 
                Zero, 
                LNKH, 
                Zero
            }, 

            Package (0x04)
            {
                0x0018FFFF, 
                Zero, 
                LNKB, 
                Zero
            }, 

            Package (0x04)
            {
                0x0018FFFF, 
                0x02, 
                LNKD, 
                Zero
            }, 

            Package (0x04)
            {
                0x0018FFFF, 
                0x03, 
                LNKC, 
                Zero
            }, 

            Package (0x04)
            {
                0x0018FFFF, 
                One, 
                LNKA, 
                Zero
            }, 

            Package (0x04)
            {
                0x001AFFFF, 
                Zero, 
                LNKF, 
                Zero
            }, 

            Package (0x04)
            {
                0x001DFFFF, 
                Zero, 
                LNKH, 
                Zero
            }, 

            Package (0x04)
            {
                0x001EFFFF, 
                Zero, 
                LNKD, 
                Zero
            }, 

            Package (0x04)
            {
                0x001EFFFF, 
                0x03, 
                LNKA, 
                Zero
            }, 

            Package (0x04)
            {
                0x001EFFFF, 
                One, 
                LNKB, 
                Zero
            }, 

            Package (0x04)
            {
                0x001EFFFF, 
                0x02, 
                LNKC, 
                Zero
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                Zero, 
                LNKA, 
                Zero
            }
        })
        Name (AR00, Package (0x11)
        {
            Package (0x04)
            {
                0x0010FFFF, 
                Zero, 
                Zero, 
                0x10
            }, 

            Package (0x04)
            {
                0x0011FFFF, 
                Zero, 
                Zero, 
                0x11
            }, 

            Package (0x04)
            {
                0x0012FFFF, 
                Zero, 
                Zero, 
                0x12
            }, 

            Package (0x04)
            {
                0x0014FFFF, 
                Zero, 
                Zero, 
                0x14
            }, 

            Package (0x04)
            {
                0x0015FFFF, 
                Zero, 
                Zero, 
                0x15
            }, 

            Package (0x04)
            {
                0x0016FFFF, 
                Zero, 
                Zero, 
                0x16
            }, 

            Package (0x04)
            {
                0x0018FFFF, 
                Zero, 
                Zero, 
                0x11
            }, 

            Package (0x04)
            {
                0x0018FFFF, 
                0x02, 
                Zero, 
                0x13
            }, 

            Package (0x04)
            {
                0x0018FFFF, 
                0x03, 
                Zero, 
                0x12
            }, 

            Package (0x04)
            {
                0x0018FFFF, 
                One, 
                Zero, 
                0x10
            }, 

            Package (0x04)
            {
                0x001AFFFF, 
                Zero, 
                Zero, 
                0x15
            }, 

            Package (0x04)
            {
                0x001DFFFF, 
                Zero, 
                Zero, 
                0x17
            }, 

            Package (0x04)
            {
                0x001EFFFF, 
                Zero, 
                Zero, 
                0x13
            }, 

            Package (0x04)
            {
                0x001EFFFF, 
                0x03, 
                Zero, 
                0x10
            }, 

            Package (0x04)
            {
                0x001EFFFF, 
                One, 
                Zero, 
                0x11
            }, 

            Package (0x04)
            {
                0x001EFFFF, 
                0x02, 
                Zero, 
                0x12
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                Zero, 
                Zero, 
                0x10
            }
        })
        Name (PR04, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                LNKA, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                LNKB, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                LNKC, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                LNKD, 
                Zero
            }
        })
        Name (AR04, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                Zero, 
                0x10
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                Zero, 
                0x11
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                Zero, 
                0x12
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                Zero, 
                0x13
            }
        })
        Name (PR05, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                LNKB, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                LNKC, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                LNKD, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                LNKA, 
                Zero
            }
        })
        Name (AR05, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                Zero, 
                0x11
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                Zero, 
                0x12
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                Zero, 
                0x13
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                Zero, 
                0x10
            }
        })
        Name (PR06, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                LNKC, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                LNKD, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                LNKA, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                LNKB, 
                Zero
            }
        })
        Name (AR06, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                Zero, 
                0x12
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                Zero, 
                0x13
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                Zero, 
                0x10
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                Zero, 
                0x11
            }
        })
        Name (PR07, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                LNKD, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                LNKA, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                LNKB, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                LNKC, 
                Zero
            }
        })
        Name (AR07, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                Zero, 
                0x13
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                Zero, 
                0x10
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                Zero, 
                0x11
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                Zero, 
                0x12
            }
        })
        Name (PR01, Package (0x10)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                LNKF, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                LNKG, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                LNKH, 
                Zero
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                LNKE, 
                Zero
            }, 

            Package (0x04)
            {
                0x0001FFFF, 
                Zero, 
                LNKG, 
                Zero
            }, 

            Package (0x04)
            {
                0x0001FFFF, 
                One, 
                LNKF, 
                Zero
            }, 

            Package (0x04)
            {
                0x0001FFFF, 
                0x02, 
                LNKE, 
                Zero
            }, 

            Package (0x04)
            {
                0x0001FFFF, 
                0x03, 
                LNKH, 
                Zero
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                Zero, 
                LNKC, 
                Zero
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                One, 
                LNKD, 
                Zero
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                0x02, 
                LNKB, 
                Zero
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                0x03, 
                LNKA, 
                Zero
            }, 

            Package (0x04)
            {
                0x0003FFFF, 
                Zero, 
                LNKD, 
                Zero
            }, 

            Package (0x04)
            {
                0x0003FFFF, 
                One, 
                LNKC, 
                Zero
            }, 

            Package (0x04)
            {
                0x0003FFFF, 
                0x02, 
                LNKF, 
                Zero
            }, 

            Package (0x04)
            {
                0x0003FFFF, 
                0x03, 
                LNKG, 
                Zero
            }
        })
        Name (AR01, Package (0x10)
        {
            Package (0x04)
            {
                0xFFFF, 
                Zero, 
                Zero, 
                0x15
            }, 

            Package (0x04)
            {
                0xFFFF, 
                One, 
                Zero, 
                0x16
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x02, 
                Zero, 
                0x17
            }, 

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                Zero, 
                0x14
            }, 

            Package (0x04)
            {
                0x0001FFFF, 
                Zero, 
                Zero, 
                0x16
            }, 

            Package (0x04)
            {
                0x0001FFFF, 
                One, 
                Zero, 
                0x15
            }, 

            Package (0x04)
            {
                0x0001FFFF, 
                0x02, 
                Zero, 
                0x14
            }, 

            Package (0x04)
            {
                0x0001FFFF, 
                0x03, 
                Zero, 
                0x17
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                Zero, 
                Zero, 
                0x12
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                One, 
                Zero, 
                0x13
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                0x02, 
                Zero, 
                0x11
            }, 

            Package (0x04)
            {
                0x0002FFFF, 
                0x03, 
                Zero, 
                0x10
            }, 

            Package (0x04)
            {
                0x0003FFFF, 
                Zero, 
                Zero, 
                0x13
            }, 

            Package (0x04)
            {
                0x0003FFFF, 
                One, 
                Zero, 
                0x12
            }, 

            Package (0x04)
            {
                0x0003FFFF, 
                0x02, 
                Zero, 
                0x15
            }, 

            Package (0x04)
            {
                0x0003FFFF, 
                0x03, 
                Zero, 
                0x16
            }
        })
        Name (PRSA, ResourceTemplate ()
        {
            IRQ (Level, ActiveLow, Shared, )
                {3,4,5,6,10,11,12,14,15}
        })
        Alias (PRSA, PRSB)
        Alias (PRSA, PRSC)
        Alias (PRSA, PRSD)
        Alias (PRSA, PRSE)
        Alias (PRSA, PRSF)
        Alias (PRSA, PRSG)
        Alias (PRSA, PRSH)
        Device (PCI0)
        {
            Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */)  // _HID: Hardware ID
            Name (_CID, EisaId ("PNP0A03") /* PCI Bus */)  // _CID: Compatible ID
            Name (_ADR, Zero)  // _ADR: Address
            Method (^BN00, 0, NotSerialized)
            {
                Return (Zero)
            }

            Method (_BBN, 0, NotSerialized)  // _BBN: BIOS Bus Number
            {
                Return (BN00 ())
            }

            Name (_UID, Zero)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
            {
                If (PICM)
                {
                    Return (AR00) /* \_SB_.AR00 */
                }

                Return (PR00) /* \_SB_.PR00 */
            }

            Device (VLVC)
            {
                Name (_ADR, Zero)  // _ADR: Address
                OperationRegion (HBUS, PCI_Config, Zero, 0xFF)
                Field (HBUS, DWordAcc, NoLock, Preserve)
                {
                    Offset (0xD0), 
                    SMCR,   32, 
                    SMDR,   32, 
                    MCRX,   32
                }

                Method (RMBR, 2, Serialized)
                {
                    Local0 = ((Arg0 << 0x10) | (Arg1 << 0x08))
                    SMCR = (0x100000F0 | Local0)
                    Return (SMDR) /* \_SB_.PCI0.VLVC.SMDR */
                }

                Method (WMBR, 3, Serialized)
                {
                    SMDR = Arg2
                    Local0 = ((Arg0 << 0x10) | (Arg1 << 0x08))
                    SMCR = (0x110000F0 | Local0)
                }
            }

            Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
            {
                If (TPMP)
                {
                    CreateDWordField (RES0, \_SB.PCI0._Y00._LEN, TPML)  // _LEN: Length
                    TPML = 0x1000
                }

                CreateDWordField (RES0, \_SB.PCI0._Y01._MIN, ISMN)  // _MIN: Minimum Base Address
                CreateDWordField (RES0, \_SB.PCI0._Y01._MAX, ISMX)  // _MAX: Maximum Base Address
                CreateDWordField (RES0, \_SB.PCI0._Y01._LEN, ISLN)  // _LEN: Length
                If ((ISPD == One))
                {
                    ISMN = ISPA /* \ISPA */
                    ISMX = (ISMN + ISLN) /* \_SB_.PCI0._CRS.ISLN */
                    ISMX -= One
                }
                Else
                {
                    ISMN = Zero
                    ISMX = Zero
                    ISLN = Zero
                }

                CreateDWordField (RES0, \_SB.PCI0._Y02._MIN, M1MN)  // _MIN: Minimum Base Address
                CreateDWordField (RES0, \_SB.PCI0._Y02._MAX, M1MX)  // _MAX: Maximum Base Address
                CreateDWordField (RES0, \_SB.PCI0._Y02._LEN, M1LN)  // _LEN: Length
                M1MN = (BMBD & 0xFF000000)
                M1MX = PCIT /* \PCIT */
                M1LN = ((M1MX - M1MN) + One)
                M1MX -= One
                CreateDWordField (RES0, \_SB.PCI0._Y03._MIN, GSMN)  // _MIN: Minimum Base Address
                CreateDWordField (RES0, \_SB.PCI0._Y03._MAX, GSMX)  // _MAX: Maximum Base Address
                CreateDWordField (RES0, \_SB.PCI0._Y03._LEN, GSLN)  // _LEN: Length
                GSMN = ^GFX0.GSTM /* \_SB_.PCI0.GFX0.GSTM */
                GSLN = (^GFX0.GUMA << 0x19)
                GSMX = (GSMN + GSLN) /* \_SB_.PCI0._CRS.GSLN */
                GSMX -= One
                Return (RES0) /* \_SB_.PCI0.RES0 */
            }

            Name (RES0, ResourceTemplate ()
            {
                WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
                    0x0000,             // Granularity
                    0x0000,             // Range Minimum
                    0x00FF,             // Range Maximum
                    0x0000,             // Translation Offset
                    0x0100,             // Length
                    ,, )
                IO (Decode16,
                    0x0070,             // Range Minimum
                    0x0077,             // Range Maximum
                    0x01,               // Alignment
                    0x08,               // Length
                    )
                IO (Decode16,
                    0x0CF8,             // Range Minimum
                    0x0CF8,             // Range Maximum
                    0x01,               // Alignment
                    0x08,               // Length
                    )
                WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                    0x0000,             // Granularity
                    0x0000,             // Range Minimum
                    0x006F,             // Range Maximum
                    0x0000,             // Translation Offset
                    0x0070,             // Length
                    ,, , TypeStatic)
                WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                    0x0000,             // Granularity
                    0x0078,             // Range Minimum
                    0x0CF7,             // Range Maximum
                    0x0000,             // Translation Offset
                    0x0C80,             // Length
                    ,, , TypeStatic)
                WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                    0x0000,             // Granularity
                    0x0D00,             // Range Minimum
                    0xFFFF,             // Range Maximum
                    0x0000,             // Translation Offset
                    0xF300,             // Length
                    ,, , TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x000A0000,         // Range Minimum
                    0x000BFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00020000,         // Length
                    ,, , AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x000C0000,         // Range Minimum
                    0x000DFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00020000,         // Length
                    ,, , AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x000E0000,         // Range Minimum
                    0x000FFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00020000,         // Length
                    ,, , AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x7A000000,         // Range Minimum
                    0x7A3FFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00400000,         // Length
                    ,, _Y01, AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x7C000000,         // Range Minimum
                    0x7FFFFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x04000000,         // Length
                    ,, _Y03, AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x80000000,         // Range Minimum
                    0xDFFFFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x60000000,         // Length
                    ,, _Y02, AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0xFED40000,         // Range Minimum
                    0xFED40FFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00001000,         // Length
                    ,, _Y00, AddressRangeMemory, TypeStatic)
            })
            Name (GUID, ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */)
            Name (SUPP, Zero)
            Name (CTRL, Zero)
            Method (_OSC, 4, Serialized)  // _OSC: Operating System Capabilities
            {
                Local0 = Arg3
                CreateDWordField (Local0, Zero, CDW1)
                CreateDWordField (Local0, 0x04, CDW2)
                CreateDWordField (Local0, 0x08, CDW3)
                If (((Arg0 == GUID) && NEXP))
                {
                    SUPP = CDW2 /* \_SB_.PCI0._OSC.CDW2 */
                    CTRL = CDW3 /* \_SB_.PCI0._OSC.CDW3 */
                    If (~(CDW1 & One))
                    {
                        If ((CTRL & 0x02))
                        {
                            NHPG ()
                        }

                        If ((CTRL & 0x04))
                        {
                            NPME ()
                        }
                    }

                    If ((Arg1 != One))
                    {
                        CDW1 |= 0x08
                    }

                    If ((CDW3 != CTRL))
                    {
                        CDW1 |= 0x10
                    }

                    CDW3 = CTRL /* \_SB_.PCI0.CTRL */
                    OSCC = CTRL /* \_SB_.PCI0.CTRL */
                    Return (Local0)
                }
                Else
                {
                    CDW1 |= 0x04
                    Return (Local0)
                }
            }

            Device (LPCB)
            {
                Name (_ADR, 0x001F0000)  // _ADR: Address
                Scope (\_SB)
                {
                    OperationRegion (ILBR, SystemMemory, IBAS, 0x8C)
                    Field (ILBR, AnyAcc, NoLock, Preserve)
                    {
                        Offset (0x08), 
                        PARC,   8, 
                        PBRC,   8, 
                        PCRC,   8, 
                        PDRC,   8, 
                        PERC,   8, 
                        PFRC,   8, 
                        PGRC,   8, 
                        PHRC,   8, 
                        Offset (0x88), 
                            ,   3, 
                        UI3E,   1, 
                        UI4E,   1
                    }

                    Device (LNKA)
                    {
                        Name (_HID, EisaId ("PNP0C0F") /* PCI Interrupt Link Device */)  // _HID: Hardware ID
                        Name (_UID, One)  // _UID: Unique ID
                        Method (_DIS, 0, Serialized)  // _DIS: Disable Device
                        {
                            PARC |= 0x80
                        }

                        Method (_PRS, 0, Serialized)  // _PRS: Possible Resource Settings
                        {
                            Return (PRSA) /* \_SB_.PRSA */
                        }

                        Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                        {
                            Name (RTLA, ResourceTemplate ()
                            {
                                IRQ (Level, ActiveLow, Shared, )
                                    {}
                            })
                            CreateWordField (RTLA, One, IRQ0)
                            IRQ0 = Zero
                            IRQ0 = (One << (PARC & 0x0F))
                            Return (RTLA) /* \_SB_.LNKA._CRS.RTLA */
                        }

                        Method (_SRS, 1, Serialized)  // _SRS: Set Resource Settings
                        {
                            CreateWordField (Arg0, One, IRQ0)
                            FindSetRightBit (IRQ0, Local0)
                            Local0--
                            PARC = Local0
                        }

                        Method (_STA, 0, Serialized)  // _STA: Status
                        {
                            If ((PARC & 0x80))
                            {
                                Return (0x09)
                            }
                            Else
                            {
                                Return (0x0B)
                            }
                        }
                    }

                    Device (LNKB)
                    {
                        Name (_HID, EisaId ("PNP0C0F") /* PCI Interrupt Link Device */)  // _HID: Hardware ID
                        Name (_UID, 0x02)  // _UID: Unique ID
                        Method (_DIS, 0, Serialized)  // _DIS: Disable Device
                        {
                            PBRC |= 0x80
                        }

                        Method (_PRS, 0, Serialized)  // _PRS: Possible Resource Settings
                        {
                            Return (PRSB) /* \_SB_.PRSB */
                        }

                        Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                        {
                            Name (RTLB, ResourceTemplate ()
                            {
                                IRQ (Level, ActiveLow, Shared, )
                                    {}
                            })
                            CreateWordField (RTLB, One, IRQ0)
                            IRQ0 = Zero
                            IRQ0 = (One << (PBRC & 0x0F))
                            Return (RTLB) /* \_SB_.LNKB._CRS.RTLB */
                        }

                        Method (_SRS, 1, Serialized)  // _SRS: Set Resource Settings
                        {
                            CreateWordField (Arg0, One, IRQ0)
                            FindSetRightBit (IRQ0, Local0)
                            Local0--
                            PBRC = Local0
                        }

                        Method (_STA, 0, Serialized)  // _STA: Status
                        {
                            If ((PBRC & 0x80))
                            {
                                Return (0x09)
                            }
                            Else
                            {
                                Return (0x0B)
                            }
                        }
                    }

                    Device (LNKC)
                    {
                        Name (_HID, EisaId ("PNP0C0F") /* PCI Interrupt Link Device */)  // _HID: Hardware ID
                        Name (_UID, 0x03)  // _UID: Unique ID
                        Method (_DIS, 0, Serialized)  // _DIS: Disable Device
                        {
                            PCRC |= 0x80
                        }

                        Method (_PRS, 0, Serialized)  // _PRS: Possible Resource Settings
                        {
                            Return (PRSC) /* \_SB_.PRSC */
                        }

                        Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                        {
                            Name (RTLC, ResourceTemplate ()
                            {
                                IRQ (Level, ActiveLow, Shared, )
                                    {}
                            })
                            CreateWordField (RTLC, One, IRQ0)
                            IRQ0 = Zero
                            IRQ0 = (One << (PCRC & 0x0F))
                            Return (RTLC) /* \_SB_.LNKC._CRS.RTLC */
                        }

                        Method (_SRS, 1, Serialized)  // _SRS: Set Resource Settings
                        {
                            CreateWordField (Arg0, One, IRQ0)
                            FindSetRightBit (IRQ0, Local0)
                            Local0--
                            PCRC = Local0
                        }

                        Method (_STA, 0, Serialized)  // _STA: Status
                        {
                            If ((PCRC & 0x80))
                            {
                                Return (0x09)
                            }
                            Else
                            {
                                Return (0x0B)
                            }
                        }
                    }

                    Device (LNKD)
                    {
                        Name (_HID, EisaId ("PNP0C0F") /* PCI Interrupt Link Device */)  // _HID: Hardware ID
                        Name (_UID, 0x04)  // _UID: Unique ID
                        Method (_DIS, 0, Serialized)  // _DIS: Disable Device
                        {
                            PDRC |= 0x80
                        }

                        Method (_PRS, 0, Serialized)  // _PRS: Possible Resource Settings
                        {
                            Return (PRSD) /* \_SB_.PRSD */
                        }

                        Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                        {
                            Name (RTLD, ResourceTemplate ()
                            {
                                IRQ (Level, ActiveLow, Shared, )
                                    {}
                            })
                            CreateWordField (RTLD, One, IRQ0)
                            IRQ0 = Zero
                            IRQ0 = (One << (PDRC & 0x0F))
                            Return (RTLD) /* \_SB_.LNKD._CRS.RTLD */
                        }

                        Method (_SRS, 1, Serialized)  // _SRS: Set Resource Settings
                        {
                            CreateWordField (Arg0, One, IRQ0)
                            FindSetRightBit (IRQ0, Local0)
                            Local0--
                            PDRC = Local0
                        }

                        Method (_STA, 0, Serialized)  // _STA: Status
                        {
                            If ((PDRC & 0x80))
                            {
                                Return (0x09)
                            }
                            Else
                            {
                                Return (0x0B)
                            }
                        }
                    }

                    Device (LNKE)
                    {
                        Name (_HID, EisaId ("PNP0C0F") /* PCI Interrupt Link Device */)  // _HID: Hardware ID
                        Name (_UID, 0x05)  // _UID: Unique ID
                        Method (_DIS, 0, Serialized)  // _DIS: Disable Device
                        {
                            PERC |= 0x80
                        }

                        Method (_PRS, 0, Serialized)  // _PRS: Possible Resource Settings
                        {
                            Return (PRSE) /* \_SB_.PRSE */
                        }

                        Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                        {
                            Name (RTLE, ResourceTemplate ()
                            {
                                IRQ (Level, ActiveLow, Shared, )
                                    {}
                            })
                            CreateWordField (RTLE, One, IRQ0)
                            IRQ0 = Zero
                            IRQ0 = (One << (PERC & 0x0F))
                            Return (RTLE) /* \_SB_.LNKE._CRS.RTLE */
                        }

                        Method (_SRS, 1, Serialized)  // _SRS: Set Resource Settings
                        {
                            CreateWordField (Arg0, One, IRQ0)
                            FindSetRightBit (IRQ0, Local0)
                            Local0--
                            PERC = Local0
                        }

                        Method (_STA, 0, Serialized)  // _STA: Status
                        {
                            If ((PERC & 0x80))
                            {
                                Return (0x09)
                            }
                            Else
                            {
                                Return (0x0B)
                            }
                        }
                    }

                    Device (LNKF)
                    {
                        Name (_HID, EisaId ("PNP0C0F") /* PCI Interrupt Link Device */)  // _HID: Hardware ID
                        Name (_UID, 0x06)  // _UID: Unique ID
                        Method (_DIS, 0, Serialized)  // _DIS: Disable Device
                        {
                            PFRC |= 0x80
                        }

                        Method (_PRS, 0, Serialized)  // _PRS: Possible Resource Settings
                        {
                            Return (PRSF) /* \_SB_.PRSF */
                        }

                        Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                        {
                            Name (RTLF, ResourceTemplate ()
                            {
                                IRQ (Level, ActiveLow, Shared, )
                                    {}
                            })
                            CreateWordField (RTLF, One, IRQ0)
                            IRQ0 = Zero
                            IRQ0 = (One << (PFRC & 0x0F))
                            Return (RTLF) /* \_SB_.LNKF._CRS.RTLF */
                        }

                        Method (_SRS, 1, Serialized)  // _SRS: Set Resource Settings
                        {
                            CreateWordField (Arg0, One, IRQ0)
                            FindSetRightBit (IRQ0, Local0)
                            Local0--
                            PFRC = Local0
                        }

                        Method (_STA, 0, Serialized)  // _STA: Status
                        {
                            If ((PFRC & 0x80))
                            {
                                Return (0x09)
                            }
                            Else
                            {
                                Return (0x0B)
                            }
                        }
                    }

                    Device (LNKG)
                    {
                        Name (_HID, EisaId ("PNP0C0F") /* PCI Interrupt Link Device */)  // _HID: Hardware ID
                        Name (_UID, 0x07)  // _UID: Unique ID
                        Method (_DIS, 0, Serialized)  // _DIS: Disable Device
                        {
                            PGRC |= 0x80
                        }

                        Method (_PRS, 0, Serialized)  // _PRS: Possible Resource Settings
                        {
                            Return (PRSG) /* \_SB_.PRSG */
                        }

                        Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                        {
                            Name (RTLG, ResourceTemplate ()
                            {
                                IRQ (Level, ActiveLow, Shared, )
                                    {}
                            })
                            CreateWordField (RTLG, One, IRQ0)
                            IRQ0 = Zero
                            IRQ0 = (One << (PGRC & 0x0F))
                            Return (RTLG) /* \_SB_.LNKG._CRS.RTLG */
                        }

                        Method (_SRS, 1, Serialized)  // _SRS: Set Resource Settings
                        {
                            CreateWordField (Arg0, One, IRQ0)
                            FindSetRightBit (IRQ0, Local0)
                            Local0--
                            PGRC = Local0
                        }

                        Method (_STA, 0, Serialized)  // _STA: Status
                        {
                            If ((PGRC & 0x80))
                            {
                                Return (0x09)
                            }
                            Else
                            {
                                Return (0x0B)
                            }
                        }
                    }

                    Device (LNKH)
                    {
                        Name (_HID, EisaId ("PNP0C0F") /* PCI Interrupt Link Device */)  // _HID: Hardware ID
                        Name (_UID, 0x08)  // _UID: Unique ID
                        Method (_DIS, 0, Serialized)  // _DIS: Disable Device
                        {
                            PHRC |= 0x80
                        }

                        Method (_PRS, 0, Serialized)  // _PRS: Possible Resource Settings
                        {
                            Return (PRSH) /* \_SB_.PRSH */
                        }

                        Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                        {
                            Name (RTLH, ResourceTemplate ()
                            {
                                IRQ (Level, ActiveLow, Shared, )
                                    {}
                            })
                            CreateWordField (RTLH, One, IRQ0)
                            IRQ0 = Zero
                            IRQ0 = (One << (PHRC & 0x0F))
                            Return (RTLH) /* \_SB_.LNKH._CRS.RTLH */
                        }

                        Method (_SRS, 1, Serialized)  // _SRS: Set Resource Settings
                        {
                            CreateWordField (Arg0, One, IRQ0)
                            FindSetRightBit (IRQ0, Local0)
                            Local0--
                            PHRC = Local0
                        }

                        Method (_STA, 0, Serialized)  // _STA: Status
                        {
                            If ((PHRC & 0x80))
                            {
                                Return (0x09)
                            }
                            Else
                            {
                                Return (0x0B)
                            }
                        }
                    }
                }

                OperationRegion (LPC0, PCI_Config, Zero, 0xC0)
                Field (LPC0, AnyAcc, NoLock, Preserve)
                {
                    Offset (0x08), 
                    SRID,   8, 
                    Offset (0x80), 
                    C1EN,   1, 
                    Offset (0x84)
                }

                Device (FWHD)
                {
                    Name (_HID, EisaId ("INT0800") /* Intel 82802 Firmware Hub Device */)  // _HID: Hardware ID
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        Memory32Fixed (ReadOnly,
                            0xFF000000,         // Address Base
                            0x01000000,         // Address Length
                            )
                    })
                }

                Device (IPIC)
                {
                    Name (_HID, EisaId ("PNP0000") /* 8259-compatible Programmable Interrupt Controller */)  // _HID: Hardware ID
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x0020,             // Range Minimum
                            0x0020,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0024,             // Range Minimum
                            0x0024,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0028,             // Range Minimum
                            0x0028,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x002C,             // Range Minimum
                            0x002C,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0030,             // Range Minimum
                            0x0030,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0034,             // Range Minimum
                            0x0034,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0038,             // Range Minimum
                            0x0038,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x003C,             // Range Minimum
                            0x003C,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00A0,             // Range Minimum
                            0x00A0,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00A4,             // Range Minimum
                            0x00A4,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00A8,             // Range Minimum
                            0x00A8,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00AC,             // Range Minimum
                            0x00AC,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00B0,             // Range Minimum
                            0x00B0,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00B4,             // Range Minimum
                            0x00B4,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00B8,             // Range Minimum
                            0x00B8,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00BC,             // Range Minimum
                            0x00BC,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x04D0,             // Range Minimum
                            0x04D0,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IRQNoFlags ()
                            {2}
                    })
                }

                Device (LDRC)
                {
                    Name (_HID, EisaId ("PNP0C02") /* PNP Motherboard Resources */)  // _HID: Hardware ID
                    Name (_UID, 0x02)  // _UID: Unique ID
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x002E,             // Range Minimum
                            0x002E,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x004E,             // Range Minimum
                            0x004E,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0061,             // Range Minimum
                            0x0061,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0063,             // Range Minimum
                            0x0063,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0065,             // Range Minimum
                            0x0065,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0067,             // Range Minimum
                            0x0067,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0070,             // Range Minimum
                            0x0070,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0080,             // Range Minimum
                            0x0080,             // Range Maximum
                            0x01,               // Alignment
                            0x10,               // Length
                            )
                        IO (Decode16,
                            0x0092,             // Range Minimum
                            0x0092,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x00B2,             // Range Minimum
                            0x00B2,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0680,             // Range Minimum
                            0x0680,             // Range Maximum
                            0x01,               // Alignment
                            0x20,               // Length
                            )
                        IO (Decode16,
                            0x0400,             // Range Minimum
                            0x0400,             // Range Maximum
                            0x01,               // Alignment
                            0x80,               // Length
                            )
                        IO (Decode16,
                            0x0500,             // Range Minimum
                            0x0500,             // Range Maximum
                            0x01,               // Alignment
                            0xFF,               // Length
                            )
                        IO (Decode16,
                            0x0600,             // Range Minimum
                            0x0600,             // Range Maximum
                            0x01,               // Alignment
                            0x20,               // Length
                            )
                        IO (Decode16,
                            0x164E,             // Range Minimum
                            0x164E,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                    })
                }

                Device (TIMR)
                {
                    Name (_HID, EisaId ("PNP0100") /* PC-class System Timer */)  // _HID: Hardware ID
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x0040,             // Range Minimum
                            0x0040,             // Range Maximum
                            0x01,               // Alignment
                            0x04,               // Length
                            )
                        IO (Decode16,
                            0x0050,             // Range Minimum
                            0x0050,             // Range Maximum
                            0x10,               // Alignment
                            0x04,               // Length
                            )
                        IRQNoFlags ()
                            {0}
                    })
                }

                Device (IUR3)
                {
                    Name (_HID, EisaId ("PNP0501") /* 16550A-compatible COM Serial Port */)  // _HID: Hardware ID
                    Name (_UID, One)  // _UID: Unique ID
                    Method (_STA, 0, Serialized)  // _STA: Status
                    {
                        If ((USEL == Zero))
                        {
                            If ((PU1E == One))
                            {
                                UI3E = One
                                UI4E = One
                                C1EN = One
                                Return (0x0F)
                            }
                        }

                        Return (Zero)
                    }

                    Method (_DIS, 0, Serialized)  // _DIS: Disable Device
                    {
                        UI3E = Zero
                        UI4E = Zero
                        C1EN = Zero
                    }

                    Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUF0, ResourceTemplate ()
                        {
                            IO (Decode16,
                                0x03F8,             // Range Minimum
                                0x03F8,             // Range Maximum
                                0x01,               // Alignment
                                0x08,               // Length
                                )
                            IRQNoFlags ()
                                {3}
                        })
                        Name (BUF1, ResourceTemplate ()
                        {
                            IO (Decode16,
                                0x03F8,             // Range Minimum
                                0x03F8,             // Range Maximum
                                0x01,               // Alignment
                                0x08,               // Length
                                )
                            IRQNoFlags ()
                                {4}
                        })
                        If ((SRID <= 0x04))
                        {
                            Return (BUF0) /* \_SB_.PCI0.LPCB.IUR3._CRS.BUF0 */
                        }
                        Else
                        {
                            Return (BUF1) /* \_SB_.PCI0.LPCB.IUR3._CRS.BUF1 */
                        }
                    }
                }
            }
        }
    }

    Scope (\)
    {
        OperationRegion (PMIO, SystemIO, PMBS, 0x46)
        Field (PMIO, ByteAcc, NoLock, Preserve)
        {
            Offset (0x01), 
            PWBS,   1, 
            Offset (0x20), 
                ,   13, 
            PMEB,   1, 
            Offset (0x42), 
                ,   1, 
            GPEC,   1
        }

        Field (PMIO, ByteAcc, NoLock, WriteAsZeros)
        {
            Offset (0x20), 
                ,   4, 
            PSCI,   1, 
            SCIS,   1
        }

        OperationRegion (PMCR, SystemMemory, PFDR, 0x04)
        Field (PMCR, DWordAcc, Lock, Preserve)
        {
            L10D,   1, 
            L11D,   1, 
            L12D,   1, 
            L13D,   1, 
            L14D,   1, 
            L15D,   1, 
            Offset (0x01), 
            SD1D,   1, 
            SD2D,   1, 
            SD3D,   1, 
            HSID,   1, 
                ,   1, 
            LPED,   1, 
            OTGD,   1, 
            Offset (0x02), 
                ,   1, 
                ,   1, 
                ,   1, 
                ,   1, 
            RP1D,   1, 
            RP2D,   1, 
            RP3D,   1, 
            RP4D,   1, 
            L20D,   1, 
            L21D,   1, 
            L22D,   1, 
            L23D,   1, 
            L24D,   1, 
            L25D,   1, 
            L26D,   1, 
            L27D,   1
        }

        OperationRegion (CLKC, SystemMemory, PCLK, 0x18)
        Field (CLKC, DWordAcc, Lock, Preserve)
        {
            CKC0,   2, 
            CKF0,   1, 
            Offset (0x04), 
            CKC1,   2, 
            CKF1,   1, 
            Offset (0x08), 
            CKC2,   2, 
            CKF2,   1, 
            Offset (0x0C), 
            CKC3,   2, 
            CKF3,   1, 
            Offset (0x10), 
            CKC4,   2, 
            CKF4,   1, 
            Offset (0x14), 
            CKC5,   2, 
            CKF5,   1, 
            Offset (0x18)
        }
    }

    Scope (_SB)
    {
        Device (LPEA)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F28" /* Intel SST Audio DSP */)  // _HID: Hardware ID
            Name (_CID, "80860F28" /* Intel SST Audio DSP */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) Low Power Audio Controller - 80860F28")  // _DDN: DOS Device Name
            Name (_SUB, "17AA7004")  // _SUB: Subsystem ID
            Name (_UID, One)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                ^SPI1.AUDI
            })
            Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
            {
                PLPE
            })
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((LPEE == 0x02) && (LPED == Zero)))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

            Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
            {
            }

            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x12345678,         // Address Base
                    0x00200000,         // Address Length
                    _Y04)
                Memory32Fixed (ReadWrite,
                    0xFE830000,         // Address Base
                    0x00001000,         // Address Length
                    _Y05)
                Memory32Fixed (ReadWrite,
                    0x55AA55AA,         // Address Base
                    0x00200000,         // Address Length
                    _Y06)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000001D,
                }
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000018,
                }
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000019,
                }
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000001A,
                }
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000001B,
                }
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000001C,
                }
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.LPEA._Y04._BAS, B0BA)  // _BAS: Base Address
                B0BA = LPE0 /* \LPE0 */
                CreateDWordField (RBUF, \_SB.LPEA._Y05._BAS, B1BA)  // _BAS: Base Address
                B1BA = LPE1 /* \LPE1 */
                CreateDWordField (RBUF, \_SB.LPEA._Y06._BAS, B2BA)  // _BAS: Base Address
                B2BA = LPE2 /* \LPE2 */
                Return (RBUF) /* \_SB_.LPEA.RBUF */
            }

            OperationRegion (KEYS, SystemMemory, LPE1, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }

            PowerResource (PLPE, 0x05, 0x0000)
            {
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (One)
                }

                Method (_ON, 0, NotSerialized)  // _ON_: Power On
                {
                    PSAT &= 0xFFFFFFFC
                    PSAT |= Zero
                }

                Method (_OFF, 0, NotSerialized)  // _OFF: Power Off
                {
                    PSAT |= 0x03
                    PSAT |= Zero
                }
            }
        }
    }

    Scope (_SB.PCI0)
    {
        Device (XHC1)
        {
            Name (_ADR, 0x00140000)  // _ADR: Address
            Name (_DDN, "Baytrail XHCI controller (CCG core/Host only)")  // _DDN: DOS Device Name
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (_STR, Unicode ("Baytrail XHCI controller (CCG core/Host only)"))  // _STR: Description String
            Name (_S0W, 0x03)  // _S0W: S0 Device Wake State
            Name (MSET, Zero)
            Name (DDST, Zero)
            OperationRegion (PCSL, SystemMemory, 0xE00A0074, One)
            Field (PCSL, ByteAcc, NoLock, WriteAsZeros)
            {
                PMPS,   2
            }

            OperationRegion (PCSH, SystemMemory, 0xE00A0075, One)
            Field (PCSH, ByteAcc, NoLock, Preserve)
            {
                PMCH,   8
            }

            OperationRegion (XMSE, SystemMemory, 0xE00A0000, 0x0100)
            Field (XMSE, AnyAcc, NoLock, Preserve)
            {
                Offset (0x04), 
                    ,   1, 
                CMSE,   1, 
                Offset (0x10), 
                BAR0,   32, 
                Offset (0x74), 
                PMCS,   16, 
                Offset (0xB0), 
                    ,   13, 
                PHY2,   2, 
                    ,   13, 
                USHP,   1, 
                    ,   1, 
                SCFG,   1
            }

            Method (PWOF, 0, Serialized)
            {
                P8XH (Zero, 0xAA)
                SCFG = One
            }

            Method (PWON, 0, Serialized)
            {
                P8XH (Zero, 0xBB)
                SCFG = Zero
            }

            OperationRegion (XPRT, SystemMemory, (PEBS + 0x000A0000), 0x0100)
            Field (XPRT, AnyAcc, NoLock, Preserve)
            {
                DVID,   16, 
                Offset (0x74), 
                D0D3,   2, 
                Offset (0x75), 
                PMEE,   1, 
                    ,   6, 
                PMES,   1, 
                Offset (0xB0), 
                    ,   13, 
                MB13,   1, 
                MB14,   1, 
                Offset (0xB4), 
                Offset (0xD0), 
                PR2,    32, 
                PR2M,   32, 
                PR3,    32, 
                PR3M,   32
            }

            OperationRegion (XHCP, SystemMemory, (PEBS + 0x000A0000), 0x0100)
            Field (XHCP, AnyAcc, Lock, Preserve)
            {
                Offset (0x04), 
                PDBM,   16, 
                Offset (0x10), 
                MEMB,   32
            }

            Name (PCHS, Zero)
            Name (SRMB, 0x90800000)
            Method (_PS0, 0, Serialized)  // _PS0: Power State 0
            {
                ADBG ("XHC D0")
                P8XH (Zero, 0xA0)
                If ((DVID == 0xFFFF))
                {
                    Return (Zero)
                }

                SRMB = (MEMB & 0xFFFFFFF0)
                Local2 = MEMB /* \_SB_.PCI0.XHC1.MEMB */
                Local1 = PDBM /* \_SB_.PCI0.XHC1.PDBM */
                PDBM &= 0xFFFFFFFFFFFFFFF9
                MEMB = SRMB /* \_SB_.PCI0.XHC1.SRMB */
                PDBM |= 0x02
                OperationRegion (MCA1, SystemMemory, SRMB, 0x9000)
                Field (MCA1, DWordAcc, Lock, Preserve)
                {
                    Offset (0x510), 
                    R510,   32, 
                    Offset (0x520), 
                    R520,   32, 
                    Offset (0x530), 
                    R530,   32, 
                    Offset (0x540), 
                    R540,   32, 
                    Offset (0x8058), 
                    Offset (0x8059), 
                    CDES,   1, 
                    Offset (0x805A), 
                    STSP,   1, 
                        ,   3, 
                    CFEC,   1, 
                    Offset (0x8060), 
                        ,   25, 
                    EPRE,   1, 
                    Offset (0x8094), 
                        ,   14, 
                    CMMF,   1, 
                        ,   6, 
                    ESSP,   1, 
                        ,   1, 
                    DAPA,   1, 
                    Offset (0x80E0), 
                        ,   15, 
                    AX15,   1, 
                    Offset (0x80FC), 
                        ,   25, 
                    PPL1,   1, 
                    Offset (0x8110), 
                        ,   1, 
                    CRNC,   1, 
                    Offset (0x8111), 
                    EPTD,   1, 
                        ,   2, 
                    HTPP,   1, 
                        ,   8, 
                    TRMC,   1, 
                    Offset (0x8140), 
                    MIDS,   12, 
                    AWPC,   12, 
                    EIHR,   8, 
                        ,   6, 
                    SSII,   1, 
                    SSIO,   1, 
                    HSII,   1, 
                    Offset (0x8154), 
                        ,   31, 
                    CLK2,   1, 
                    Offset (0x8164), 
                    ETBC,   1, 
                    ERBC,   1, 
                    ESAI,   1, 
                    ETMA,   1, 
                    EOAI,   1, 
                    EIAI,   1, 
                    TTEA,   1, 
                    ECMA,   1, 
                    Offset (0x816C), 
                        ,   2, 
                    CLK0,   1, 
                        ,   11, 
                    CLK1,   1, 
                    Offset (0x8188), 
                    Offset (0x818B), 
                    FIDD,   1, 
                        ,   1, 
                    FTSS,   1
                }

                Local3 = D0D3 /* \_SB_.PCI0.XHC1.D0D3 */
                If ((Local3 == 0x03))
                {
                    D0D3 = Zero
                    Sleep (0x0A)
                }

                If ((PCHS == 0x02))
                {
                    MB13 = Zero
                    MB14 = Zero
                    CLK0 = Zero
                    CLK1 = Zero
                }

                CLK2 = One
                CDES = One
                STSP = One
                CFEC = Zero
                EPRE = One
                DAPA = One
                ESSP = One
                CMMF = One
                PPL1 = One
                CRNC = Zero
                EPTD = Zero
                HTPP = One
                TRMC = One
                MIDS = 0x3C
                AWPC = 0x0F
                EIHR = 0xFF
                SSII = One
                SSIO = One
                HSII = One
                ERBC = One
                ETBC = One
                ESAI = One
                ETMA = One
                EOAI = One
                EIAI = One
                TTEA = One
                ECMA = One
                FIDD = One
                FTSS = One
                USHP = Zero
                If ((PCHS == 0x02))
                {
                    While (((((R510 & 0x03FB) == 0x02E0) || ((R520 & 
                        0x03FB) == 0x02E0)) || (((R530 & 0x03FB) == 0x02E0) || ((R540 & 
                        0x03FB) == 0x02E0))))
                    {
                        Stall (0x32)
                    }

                    Local0 = R510 /* \_SB_.PCI0.XHC1._PS0.R510 */
                    If (((Local0 & 0x000203FB) == 0x02A0))
                    {
                        R510 = (Local0 | 0x80000000)
                        While (((R510 & 0x00180000) == Zero))
                        {
                            Stall (0x32)
                        }

                        Local0 = (R510 & 0xFFFFFFFFFFFFFFFD)
                        R510 = (Local0 | 0x00FE0000)
                    }

                    Local0 = R520 /* \_SB_.PCI0.XHC1._PS0.R520 */
                    If (((Local0 & 0x000203FB) == 0x02A0))
                    {
                        R520 = (Local0 | 0x80000000)
                        While (((R520 & 0x00180000) == Zero))
                        {
                            Stall (0x32)
                        }

                        Local0 = (R520 & 0xFFFFFFFFFFFFFFFD)
                        R520 = (Local0 | 0x00FE0000)
                    }

                    Local0 = R530 /* \_SB_.PCI0.XHC1._PS0.R530 */
                    If (((Local0 & 0x000203FB) == 0x02A0))
                    {
                        R530 = (Local0 | 0x80000000)
                        While (((R530 & 0x00180000) == Zero))
                        {
                            Stall (0x32)
                        }

                        Local0 = (R530 & 0xFFFFFFFFFFFFFFFD)
                        R530 = (Local0 | 0x00FE0000)
                    }

                    Local0 = R540 /* \_SB_.PCI0.XHC1._PS0.R540 */
                    If (((Local0 & 0x000203FB) == 0x02A0))
                    {
                        R540 = (Local0 | 0x80000000)
                        While (((R540 & 0x00180000) == Zero))
                        {
                            Stall (0x32)
                        }

                        Local0 = (R540 & 0xFFFFFFFFFFFFFFFD)
                        R540 = (Local0 | 0x00FE0000)
                    }

                    AX15 = One
                }

                If ((Local3 == 0x03))
                {
                    ADBG ("PS0->D3")
                    P8XH (Zero, 0xA1)
                    D0D3 = 0x03
                }
                Else
                {
                    P8XH (Zero, 0xA2)
                }

                PDBM &= 0xFFFFFFFFFFFFFFFD
                MEMB = Local2
                PDBM = Local1
            }

            Method (_PS3, 0, Serialized)  // _PS3: Power State 3
            {
                ADBG ("XHC D3")
                P8XH (Zero, 0xB0)
                If ((DVID == 0xFFFF))
                {
                    Return (Zero)
                }

                SRMB = (MEMB & 0xFFFFFFF0)
                Local2 = MEMB /* \_SB_.PCI0.XHC1.MEMB */
                Local1 = PDBM /* \_SB_.PCI0.XHC1.PDBM */
                PDBM &= 0xFFFFFFFFFFFFFFF9
                MEMB = SRMB /* \_SB_.PCI0.XHC1.SRMB */
                PDBM |= 0x02
                OperationRegion (MCA1, SystemMemory, SRMB, 0x9000)
                Field (MCA1, DWordAcc, Lock, Preserve)
                {
                    Offset (0x80E0), 
                        ,   15, 
                    AX15,   1, 
                    Offset (0x8154), 
                        ,   31, 
                    CLK2,   1, 
                    Offset (0x816C), 
                        ,   2, 
                    CLK0,   1, 
                        ,   11, 
                    CLK1,   1, 
                    Offset (0x8170)
                }

                Local3 = D0D3 /* \_SB_.PCI0.XHC1.D0D3 */
                If ((Local3 == 0x03))
                {
                    D0D3 = Zero
                }

                If ((PCHS == 0x02))
                {
                    MB13 = One
                    MB14 = One
                    CLK0 = One
                    CLK1 = One
                }

                CLK2 = Zero
                If ((PCHS == 0x02))
                {
                    AX15 = Zero
                }

                If ((PMEE == One))
                {
                    USHP = One
                }

                If ((Local3 == 0x03))
                {
                    ADBG ("PS3->D3")
                    P8XH (Zero, 0xB1)
                    D0D3 = 0x03
                }
                Else
                {
                    P8XH (Zero, 0xB2)
                }

                PDBM &= 0xFFFFFFFFFFFFFFFD
                MEMB = Local2
                PDBM = Local1
            }

            Method (_DSW, 3, NotSerialized)  // _DSW: Device Sleep Wake
            {
            }

            Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
            {
                Return (Zero)
            }

            Method (_PR3, 0, NotSerialized)  // _PR3: Power Resources for D3hot
            {
                Return (Package (0x01)
                {
                    USBC
                })
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((XHCI != Zero))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (Zero)
                }
            }

            Device (RHUB)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Device (SSP1)
                {
                    Name (_ADR, 0x07)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Name (UPCP, Package (0x04)
                        {
                            Zero, 
                            0x06, 
                            Zero, 
                            Zero
                        })
                        Return (UPCP) /* \_SB_.PCI0.XHC1.RHUB.SSP1._UPC.UPCP */
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Name (PLDP, Package (0x01)
                        {
                            Buffer (0x14)
                            {
                                /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                                /* 0008 */  0x4B, 0x19, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,  /* K....... */
                                /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                            }
                        })
                        Return (PLDP) /* \_SB_.PCI0.XHC1.RHUB.SSP1._PLD.PLDP */
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        ADBG ("DSM11")
                        If ((Arg0 == ToUUID ("ce2ee385-00e6-48cb-9f05-2edb927c4899") /* USB Controller */))
                        {
                            ADBG ("DSM12")
                            If ((Arg1 == Zero))
                            {
                                ADBG ("DSM13")
                                If ((Arg2 == Zero))
                                {
                                    ADBG ("SSP1 QUERY")
                                    Debug = "Method _DSM Function Query"
                                    Return (Buffer (One)
                                    {
                                         0x05                                             /* . */
                                    })
                                }

                                If ((Arg2 == 0x02))
                                {
                                    ADBG ("SSP1 DSM")
                                    Debug = "Method _DSM Function Index2"
                                    Return (Zero)
                                }
                            }
                        }
                        Else
                        {
                            Return (Zero)
                        }

                        Return (Zero)
                    }
                }

                Device (HS01)
                {
                    Name (_ADR, One)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Name (UPCP, Package (0x04)
                        {
                            0xFF, 
                            0x06, 
                            Zero, 
                            Zero
                        })
                        Return (UPCP) /* \_SB_.PCI0.XHC1.RHUB.HS01._UPC.UPCP */
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Name (PLDP, Package (0x01)
                        {
                            Buffer (0x14)
                            {
                                /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                                /* 0008 */  0x4B, 0x19, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,  /* K....... */
                                /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                            }
                        })
                        Return (PLDP) /* \_SB_.PCI0.XHC1.RHUB.HS01._PLD.PLDP */
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        ADBG ("DSM21")
                        If ((Arg0 == ToUUID ("ce2ee385-00e6-48cb-9f05-2edb927c4899") /* USB Controller */))
                        {
                            ADBG ("DSM22")
                            If ((Arg1 == Zero))
                            {
                                ADBG ("DSM23")
                                If ((Arg2 == Zero))
                                {
                                    ADBG ("HS01 QUERY")
                                    Debug = "Method _DSM Function Query"
                                    Return (Buffer (One)
                                    {
                                         0x05                                             /* . */
                                    })
                                }

                                If ((Arg2 == 0x02))
                                {
                                    ADBG ("HS01 DSM")
                                    Debug = "Method _DSM Function Index2"
                                    Return (Zero)
                                }
                            }
                        }
                        Else
                        {
                            Return (Zero)
                        }

                        Return (Zero)
                    }
                }

                Device (HS02)
                {
                    Name (_ADR, 0x02)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Name (UPCP, Package (0x04)
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Name (UPCR, Package (0x04)
                        {
                            0xFF, 
                            Zero, 
                            Zero, 
                            Zero
                        })
                        If ((BDID == 0x02))
                        {
                            Return (UPCR) /* \_SB_.PCI0.XHC1.RHUB.HS02._UPC.UPCR */
                        }
                        Else
                        {
                            Return (UPCP) /* \_SB_.PCI0.XHC1.RHUB.HS02._UPC.UPCP */
                        }
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Name (PLDP, Package (0x01)
                        {
                            Buffer (0x14)
                            {
                                /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                                /* 0008 */  0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* @....... */
                                /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                            }
                        })
                        Name (PLDR, Package (0x01)
                        {
                            Buffer (0x14)
                            {
                                /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                                /* 0008 */  0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* A....... */
                                /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                            }
                        })
                        If ((BDID == 0x02))
                        {
                            Return (PLDR) /* \_SB_.PCI0.XHC1.RHUB.HS02._PLD.PLDR */
                        }
                        Else
                        {
                            Return (PLDP) /* \_SB_.PCI0.XHC1.RHUB.HS02._PLD.PLDP */
                        }
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        ADBG ("DSM31")
                        If ((Arg0 == ToUUID ("ce2ee385-00e6-48cb-9f05-2edb927c4899") /* USB Controller */))
                        {
                            ADBG ("DSM32")
                            If ((Arg1 == Zero))
                            {
                                ADBG ("DSM33")
                                If ((Arg2 == Zero))
                                {
                                    ADBG ("HS02 QUERY")
                                    Debug = "Method _DSM Function Query"
                                    Return (Buffer (One)
                                    {
                                         0x05                                             /* . */
                                    })
                                }

                                If ((Arg2 == 0x02))
                                {
                                    ADBG ("HS02 DSM")
                                    Debug = "Method _DSM Function Index2"
                                    Return (Zero)
                                }
                            }
                        }
                        Else
                        {
                            Return (Zero)
                        }

                        Return (Zero)
                    }
                }

                Device (HS03)
                {
                    Name (_ADR, 0x03)  // _ADR: Address
                    Name (_DEP, Package (0x01)  // _DEP: Dependencies
                    {
                        GPO2
                    })
                    Name (_S0W, 0x02)  // _S0W: S0 Device Wake State
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Name (UPCP, Package (0x04)
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Return (UPCP) /* \_SB_.PCI0.XHC1.RHUB.HS03._UPC.UPCP */
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Name (PLDP, Package (0x01)
                        {
                            Buffer (0x14)
                            {
                                /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                                /* 0008 */  0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* 0....... */
                                /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                            }
                        })
                        Return (PLDP) /* \_SB_.PCI0.XHC1.RHUB.HS03._PLD.PLDP */
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        ADBG ("DSM41")
                        If ((Arg0 == ToUUID ("ce2ee385-00e6-48cb-9f05-2edb927c4899") /* USB Controller */))
                        {
                            ADBG ("DSM42")
                            If ((Arg1 == Zero))
                            {
                                ADBG ("DSM43")
                                If ((Arg2 == Zero))
                                {
                                    ADBG ("HS03 QUERY")
                                    Debug = "Method _DSM Function Query"
                                    Return (Buffer (One)
                                    {
                                         0x05                                             /* . */
                                    })
                                }

                                If ((Arg2 == 0x02))
                                {
                                    ADBG ("HS03 DSM")
                                    Debug = "Method _DSM Function Index2"
                                    Return (Zero)
                                }
                            }
                        }
                        Else
                        {
                            Return (Zero)
                        }

                        Return (Zero)
                    }

                    Device (MODM)
                    {
                        Name (_ADR, 0x03)  // _ADR: Address
                    }
                }

                Device (HS04)
                {
                    Name (_ADR, 0x04)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Name (UPCP, Package (0x04)
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Return (UPCP) /* \_SB_.PCI0.XHC1.RHUB.HS04._UPC.UPCP */
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Name (PLDP, Package (0x01)
                        {
                            Buffer (0x14)
                            {
                                /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                                /* 0008 */  0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* 0....... */
                                /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                            }
                        })
                        Return (PLDP) /* \_SB_.PCI0.XHC1.RHUB.HS04._PLD.PLDP */
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        ADBG ("DSM51")
                        If ((Arg0 == ToUUID ("ce2ee385-00e6-48cb-9f05-2edb927c4899") /* USB Controller */))
                        {
                            ADBG ("DSM52")
                            If ((Arg1 == Zero))
                            {
                                ADBG ("DSM53")
                                If ((Arg2 == Zero))
                                {
                                    ADBG ("HS04 QUERY")
                                    Debug = "Method _DSM Function Query"
                                    Return (Buffer (One)
                                    {
                                         0x05                                             /* . */
                                    })
                                }

                                If ((Arg2 == 0x02))
                                {
                                    ADBG ("HS04 DSM")
                                    Debug = "Method _DSM Function Index2"
                                    Return (Zero)
                                }
                            }
                        }
                        Else
                        {
                            Return (Zero)
                        }

                        Return (Zero)
                    }
                }

                Device (HSC1)
                {
                    Name (_ADR, 0x05)  // _ADR: Address
                    Name (_DEP, Package (0x01)  // _DEP: Dependencies
                    {
                        MDM
                    })
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Name (UPCP, Package (0x04)
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Return (UPCP) /* \_SB_.PCI0.XHC1.RHUB.HSC1._UPC.UPCP */
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Name (PLDP, Package (0x01)
                        {
                            Buffer (0x14)
                            {
                                /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                                /* 0008 */  0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* 0....... */
                                /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                            }
                        })
                        Return (PLDP) /* \_SB_.PCI0.XHC1.RHUB.HSC1._PLD.PLDP */
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        ADBG ("DSM61")
                        If ((Arg0 == ToUUID ("ce2ee385-00e6-48cb-9f05-2edb927c4899") /* USB Controller */))
                        {
                            ADBG ("DSM62")
                            If ((Arg1 == Zero))
                            {
                                ADBG ("DSM63")
                                If ((Arg2 == Zero))
                                {
                                    ADBG ("HSIC1 QUERY")
                                    Debug = "Method _DSM Function Query"
                                    Return (Buffer (One)
                                    {
                                         0x05                                             /* . */
                                    })
                                }

                                If ((Arg2 == 0x02))
                                {
                                    ADBG ("HSIC1 DSM")
                                    Debug = "Method _DSM Function Index2"
                                    Return (One)
                                }
                            }
                        }
                        Else
                        {
                            Return (Zero)
                        }

                        Return (Zero)
                    }
                }

                Device (HSC2)
                {
                    Name (_ADR, 0x06)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Name (UPCP, Package (0x04)
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Return (UPCP) /* \_SB_.PCI0.XHC1.RHUB.HSC2._UPC.UPCP */
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Name (PLDP, Package (0x01)
                        {
                            Buffer (0x14)
                            {
                                /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                                /* 0008 */  0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* 0....... */
                                /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                            }
                        })
                        Return (PLDP) /* \_SB_.PCI0.XHC1.RHUB.HSC2._PLD.PLDP */
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        ADBG ("DSM71")
                        If ((Arg0 == ToUUID ("ce2ee385-00e6-48cb-9f05-2edb927c4899") /* USB Controller */))
                        {
                            ADBG ("DSM72")
                            If ((Arg1 == Zero))
                            {
                                ADBG ("DSM73")
                                If ((Arg2 == Zero))
                                {
                                    ADBG ("HSIC2 QUERY")
                                    Debug = "Method _DSM Function Query"
                                    Return (Buffer (One)
                                    {
                                         0x05                                             /* . */
                                    })
                                }

                                If ((Arg2 == 0x02))
                                {
                                    ADBG ("HSIC2 DSM called")
                                    Debug = "Method _DSM Function Index2"
                                    Return (One)
                                }
                            }
                        }
                        Else
                        {
                            Return (Zero)
                        }

                        Return (Zero)
                    }
                }
            }
        }

        Device (OTG1)
        {
            Name (_ADR, 0x00160000)  // _ADR: Address
            Name (_DDN, "Baytrail XHCI controller (Synopsys core/OTG)")  // _DDN: DOS Device Name
            Name (_STR, Unicode ("Baytrail XHCI controller (Synopsys core/OTG)"))  // _STR: Description String
            Name (_S0W, 0x03)  // _S0W: S0 Device Wake State
            OperationRegion (PMEB, PCI_Config, 0x84, 0x04)
            Field (PMEB, WordAcc, NoLock, Preserve)
            {
                Offset (0x01), 
                PMEE,   1, 
                    ,   6, 
                PMES,   1
            }

            OperationRegion (GENR, PCI_Config, 0xA0, 0x10)
            Field (GENR, WordAcc, NoLock, Preserve)
            {
                    ,   18, 
                CPME,   1, 
                U2EN,   1, 
                U3EN,   1
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                CPME = One
                U2EN = One
                U3EN = One
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                CPME = Zero
                U2EN = Zero
                U3EN = Zero
            }

            Method (_DSW, 3, NotSerialized)  // _DSW: Device Sleep Wake
            {
            }

            Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
            {
                Return (Zero)
            }

            Method (_PR3, 0, NotSerialized)  // _PR3: Power Resources for D3hot
            {
                Return (Package (0x01)
                {
                    USBC
                })
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((OTGM != Zero))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (Zero)
                }
            }
        }

        Scope (\_SB)
        {
            PowerResource (USBC, 0x00, 0x0000)
            {
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Method (_ON, 0, NotSerialized)  // _ON_: Power On
                {
                }

                Method (_OFF, 0, NotSerialized)  // _OFF: Power Off
                {
                }
            }
        }

        Device (EHC1)
        {
            Name (_ADR, 0x001D0000)  // _ADR: Address
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            OperationRegion (PWKE, PCI_Config, 0x62, 0x04)
            Field (PWKE, DWordAcc, NoLock, Preserve)
            {
                    ,   1, 
                PWUC,   8
            }

            Method (_PSW, 1, NotSerialized)  // _PSW: Power State Wake
            {
                If (Arg0)
                {
                    PWUC = Ones
                }
                Else
                {
                    PWUC = Zero
                }
            }

            Device (HUBN)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Device (PR01)
                {
                    Name (_ADR, One)  // _ADR: Address
                    Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
                    {
                        0xFF, 
                        Zero, 
                        Zero, 
                        Zero
                    })
                    Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
                    {
                        ToPLD (
                            PLD_Revision       = 0x1,
                            PLD_IgnoreColor    = 0x1,
                            PLD_Red            = 0x0,
                            PLD_Green          = 0x0,
                            PLD_Blue           = 0x0,
                            PLD_Width          = 0x0,
                            PLD_Height         = 0x0,
                            PLD_UserVisible    = 0x0,
                            PLD_Dock           = 0x0,
                            PLD_Lid            = 0x0,
                            PLD_Panel          = "UNKNOWN",
                            PLD_VerticalPosition = "UPPER",
                            PLD_HorizontalPosition = "LEFT",
                            PLD_Shape          = "UNKNOWN",
                            PLD_GroupOrientation = 0x0,
                            PLD_GroupToken     = 0x0,
                            PLD_GroupPosition  = 0x0,
                            PLD_Bay            = 0x0,
                            PLD_Ejectable      = 0x0,
                            PLD_EjectRequired  = 0x0,
                            PLD_CabinetNumber  = 0x0,
                            PLD_CardCageNumber = 0x0,
                            PLD_Reference      = 0x0,
                            PLD_Rotation       = 0x0,
                            PLD_Order          = 0x0,
                            PLD_VerticalOffset = 0x0,
                            PLD_HorizontalOffset = 0x0)

                    })
                    Device (PR11)
                    {
                        Name (_ADR, One)  // _ADR: Address
                        Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
                        {
                            ToPLD (
                                PLD_Revision       = 0x1,
                                PLD_IgnoreColor    = 0x1,
                                PLD_Red            = 0x0,
                                PLD_Green          = 0x0,
                                PLD_Blue           = 0x0,
                                PLD_Width          = 0x0,
                                PLD_Height         = 0x0,
                                PLD_UserVisible    = 0x1,
                                PLD_Dock           = 0x0,
                                PLD_Lid            = 0x0,
                                PLD_Panel          = "FRONT",
                                PLD_VerticalPosition = "",
                                PLD_HorizontalPosition = "LEFT",
                                PLD_Shape          = "UNKNOWN",
                                PLD_GroupOrientation = 0x0,
                                PLD_GroupToken     = 0x0,
                                PLD_GroupPosition  = 0x0,
                                PLD_Bay            = 0x0,
                                PLD_Ejectable      = 0x0,
                                PLD_EjectRequired  = 0x0,
                                PLD_CabinetNumber  = 0x0,
                                PLD_CardCageNumber = 0x0,
                                PLD_Reference      = 0x0,
                                PLD_Rotation       = 0x0,
                                PLD_Order          = 0x0,
                                PLD_VerticalOffset = 0x0,
                                PLD_HorizontalOffset = 0x0)

                        })
                    }

                    Device (PR12)
                    {
                        Name (_ADR, 0x02)  // _ADR: Address
                        Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
                        {
                            ToPLD (
                                PLD_Revision       = 0x1,
                                PLD_IgnoreColor    = 0x1,
                                PLD_Red            = 0x0,
                                PLD_Green          = 0x0,
                                PLD_Blue           = 0x0,
                                PLD_Width          = 0x0,
                                PLD_Height         = 0x0,
                                PLD_UserVisible    = 0x1,
                                PLD_Dock           = 0x0,
                                PLD_Lid            = 0x0,
                                PLD_Panel          = "FRONT",
                                PLD_VerticalPosition = "",
                                PLD_HorizontalPosition = "CENTER",
                                PLD_Shape          = "UNKNOWN",
                                PLD_GroupOrientation = 0x0,
                                PLD_GroupToken     = 0x0,
                                PLD_GroupPosition  = 0x0,
                                PLD_Bay            = 0x0,
                                PLD_Ejectable      = 0x0,
                                PLD_EjectRequired  = 0x0,
                                PLD_CabinetNumber  = 0x0,
                                PLD_CardCageNumber = 0x0,
                                PLD_Reference      = 0x0,
                                PLD_Rotation       = 0x0,
                                PLD_Order          = 0x0,
                                PLD_VerticalOffset = 0x0,
                                PLD_HorizontalOffset = 0x0)

                        })
                    }

                    Device (PR13)
                    {
                        Name (_ADR, 0x03)  // _ADR: Address
                        Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
                        {
                            ToPLD (
                                PLD_Revision       = 0x1,
                                PLD_IgnoreColor    = 0x1,
                                PLD_Red            = 0x0,
                                PLD_Green          = 0x0,
                                PLD_Blue           = 0x0,
                                PLD_Width          = 0x0,
                                PLD_Height         = 0x0,
                                PLD_UserVisible    = 0x1,
                                PLD_Dock           = 0x0,
                                PLD_Lid            = 0x0,
                                PLD_Panel          = "FRONT",
                                PLD_VerticalPosition = "",
                                PLD_HorizontalPosition = "CENTER",
                                PLD_Shape          = "UNKNOWN",
                                PLD_GroupOrientation = 0x0,
                                PLD_GroupToken     = 0x0,
                                PLD_GroupPosition  = 0x0,
                                PLD_Bay            = 0x0,
                                PLD_Ejectable      = 0x0,
                                PLD_EjectRequired  = 0x0,
                                PLD_CabinetNumber  = 0x0,
                                PLD_CardCageNumber = 0x0,
                                PLD_Reference      = 0x0,
                                PLD_Rotation       = 0x0,
                                PLD_Order          = 0x0,
                                PLD_VerticalOffset = 0x0,
                                PLD_HorizontalOffset = 0x0)

                        })
                    }

                    Device (PR14)
                    {
                        Name (_ADR, 0x04)  // _ADR: Address
                        Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
                        {
                            ToPLD (
                                PLD_Revision       = 0x1,
                                PLD_IgnoreColor    = 0x1,
                                PLD_Red            = 0x0,
                                PLD_Green          = 0x0,
                                PLD_Blue           = 0x0,
                                PLD_Width          = 0x0,
                                PLD_Height         = 0x0,
                                PLD_UserVisible    = 0x1,
                                PLD_Dock           = 0x0,
                                PLD_Lid            = 0x0,
                                PLD_Panel          = "FRONT",
                                PLD_VerticalPosition = "",
                                PLD_HorizontalPosition = "RIGHT",
                                PLD_Shape          = "UNKNOWN",
                                PLD_GroupOrientation = 0x0,
                                PLD_GroupToken     = 0x0,
                                PLD_GroupPosition  = 0x0,
                                PLD_Bay            = 0x0,
                                PLD_Ejectable      = 0x0,
                                PLD_EjectRequired  = 0x0,
                                PLD_CabinetNumber  = 0x0,
                                PLD_CardCageNumber = 0x0,
                                PLD_Reference      = 0x0,
                                PLD_Rotation       = 0x0,
                                PLD_Order          = 0x0,
                                PLD_VerticalOffset = 0x0,
                                PLD_HorizontalOffset = 0x0)

                        })
                        Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                        {
                            Name (_T_0, Zero)  // _T_x: Emitted by ASL Compiler
                            If ((Arg0 == ToUUID ("a5fc708f-8775-4ba6-bd0c-ba90a1ec72f8")))
                            {
                                While (One)
                                {
                                    _T_0 = ToInteger (Arg2)
                                    If ((_T_0 == Zero))
                                    {
                                        If ((Arg1 == One))
                                        {
                                            Return (Buffer (One)
                                            {
                                                 0x07                                             /* . */
                                            })
                                        }
                                        Else
                                        {
                                            Return (Buffer (One)
                                            {
                                                 0x00                                             /* . */
                                            })
                                        }
                                    }
                                    Else
                                    {
                                        If ((_T_0 == One))
                                        {
                                            If ((SDGV == 0xFF))
                                            {
                                                Return (Zero)
                                            }
                                            Else
                                            {
                                                Return (One)
                                            }
                                        }
                                        Else
                                        {
                                            If ((_T_0 == 0x02))
                                            {
                                                Return (SDGV) /* \SDGV */
                                            }
                                        }
                                    }

                                    Break
                                }
                            }

                            Return (Zero)
                        }
                    }

                    Device (PR15)
                    {
                        Name (_ADR, 0x05)  // _ADR: Address
                        Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
                        {
                            ToPLD (
                                PLD_Revision       = 0x1,
                                PLD_IgnoreColor    = 0x1,
                                PLD_Red            = 0x0,
                                PLD_Green          = 0x0,
                                PLD_Blue           = 0x0,
                                PLD_Width          = 0x0,
                                PLD_Height         = 0x0,
                                PLD_UserVisible    = 0x1,
                                PLD_Dock           = 0x0,
                                PLD_Lid            = 0x0,
                                PLD_Panel          = "UNKNOWN",
                                PLD_VerticalPosition = "LOWER",
                                PLD_HorizontalPosition = "RIGHT",
                                PLD_Shape          = "UNKNOWN",
                                PLD_GroupOrientation = 0x0,
                                PLD_GroupToken     = 0x0,
                                PLD_GroupPosition  = 0x0,
                                PLD_Bay            = 0x0,
                                PLD_Ejectable      = 0x0,
                                PLD_EjectRequired  = 0x0,
                                PLD_CabinetNumber  = 0x0,
                                PLD_CardCageNumber = 0x0,
                                PLD_Reference      = 0x0,
                                PLD_Rotation       = 0x0,
                                PLD_Order          = 0x0,
                                PLD_VerticalOffset = 0x0,
                                PLD_HorizontalOffset = 0x0)

                        })
                        Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                        {
                            Name (_T_0, Zero)  // _T_x: Emitted by ASL Compiler
                            If ((Arg0 == ToUUID ("a5fc708f-8775-4ba6-bd0c-ba90a1ec72f8")))
                            {
                                While (One)
                                {
                                    _T_0 = ToInteger (Arg2)
                                    If ((_T_0 == Zero))
                                    {
                                        If ((Arg1 == One))
                                        {
                                            Return (Buffer (One)
                                            {
                                                 0x07                                             /* . */
                                            })
                                        }
                                        Else
                                        {
                                            Return (Buffer (One)
                                            {
                                                 0x00                                             /* . */
                                            })
                                        }
                                    }
                                    Else
                                    {
                                        If ((_T_0 == One))
                                        {
                                            If ((SDGV == 0xFF))
                                            {
                                                Return (Zero)
                                            }
                                            Else
                                            {
                                                Return (One)
                                            }
                                        }
                                        Else
                                        {
                                            If ((_T_0 == 0x02))
                                            {
                                                Return (SDGV) /* \SDGV */
                                            }
                                        }
                                    }

                                    Break
                                }
                            }

                            Return (Zero)
                        }
                    }

                    Device (PR16)
                    {
                        Name (_ADR, 0x06)  // _ADR: Address
                        Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
                        {
                            ToPLD (
                                PLD_Revision       = 0x1,
                                PLD_IgnoreColor    = 0x1,
                                PLD_Red            = 0x0,
                                PLD_Green          = 0x0,
                                PLD_Blue           = 0x0,
                                PLD_Width          = 0x0,
                                PLD_Height         = 0x0,
                                PLD_UserVisible    = 0x1,
                                PLD_Dock           = 0x0,
                                PLD_Lid            = 0x0,
                                PLD_Panel          = "UNKNOWN",
                                PLD_VerticalPosition = "LOWER",
                                PLD_HorizontalPosition = "RIGHT",
                                PLD_Shape          = "UNKNOWN",
                                PLD_GroupOrientation = 0x0,
                                PLD_GroupToken     = 0x0,
                                PLD_GroupPosition  = 0x0,
                                PLD_Bay            = 0x0,
                                PLD_Ejectable      = 0x0,
                                PLD_EjectRequired  = 0x0,
                                PLD_CabinetNumber  = 0x0,
                                PLD_CardCageNumber = 0x0,
                                PLD_Reference      = 0x0,
                                PLD_Rotation       = 0x0,
                                PLD_Order          = 0x0,
                                PLD_VerticalOffset = 0x0,
                                PLD_HorizontalOffset = 0x0)

                        })
                        Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                        {
                            Name (_T_0, Zero)  // _T_x: Emitted by ASL Compiler
                            If ((Arg0 == ToUUID ("a5fc708f-8775-4ba6-bd0c-ba90a1ec72f8")))
                            {
                                While (One)
                                {
                                    _T_0 = ToInteger (Arg2)
                                    If ((_T_0 == Zero))
                                    {
                                        If ((Arg1 == One))
                                        {
                                            Return (Buffer (One)
                                            {
                                                 0x07                                             /* . */
                                            })
                                        }
                                        Else
                                        {
                                            Return (Buffer (One)
                                            {
                                                 0x00                                             /* . */
                                            })
                                        }
                                    }
                                    Else
                                    {
                                        If ((_T_0 == One))
                                        {
                                            If ((SDGV == 0xFF))
                                            {
                                                Return (Zero)
                                            }
                                            Else
                                            {
                                                Return (One)
                                            }
                                        }
                                        Else
                                        {
                                            If ((_T_0 == 0x02))
                                            {
                                                Return (SDGV) /* \SDGV */
                                            }
                                        }
                                    }

                                    Break
                                }
                            }

                            Return (Zero)
                        }
                    }

                    Device (PR17)
                    {
                        Name (_ADR, 0x07)  // _ADR: Address
                        Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
                        {
                            ToPLD (
                                PLD_Revision       = 0x1,
                                PLD_IgnoreColor    = 0x1,
                                PLD_Red            = 0x0,
                                PLD_Green          = 0x0,
                                PLD_Blue           = 0x0,
                                PLD_Width          = 0x0,
                                PLD_Height         = 0x0,
                                PLD_UserVisible    = 0x1,
                                PLD_Dock           = 0x0,
                                PLD_Lid            = 0x0,
                                PLD_Panel          = "UNKNOWN",
                                PLD_VerticalPosition = "LOWER",
                                PLD_HorizontalPosition = "RIGHT",
                                PLD_Shape          = "UNKNOWN",
                                PLD_GroupOrientation = 0x0,
                                PLD_GroupToken     = 0x0,
                                PLD_GroupPosition  = 0x0,
                                PLD_Bay            = 0x0,
                                PLD_Ejectable      = 0x0,
                                PLD_EjectRequired  = 0x0,
                                PLD_CabinetNumber  = 0x0,
                                PLD_CardCageNumber = 0x0,
                                PLD_Reference      = 0x0,
                                PLD_Rotation       = 0x0,
                                PLD_Order          = 0x0,
                                PLD_VerticalOffset = 0x0,
                                PLD_HorizontalOffset = 0x0)

                        })
                        Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                        {
                            Name (_T_0, Zero)  // _T_x: Emitted by ASL Compiler
                            If ((Arg0 == ToUUID ("a5fc708f-8775-4ba6-bd0c-ba90a1ec72f8")))
                            {
                                While (One)
                                {
                                    _T_0 = ToInteger (Arg2)
                                    If ((_T_0 == Zero))
                                    {
                                        If ((Arg1 == One))
                                        {
                                            Return (Buffer (One)
                                            {
                                                 0x07                                             /* . */
                                            })
                                        }
                                        Else
                                        {
                                            Return (Buffer (One)
                                            {
                                                 0x00                                             /* . */
                                            })
                                        }
                                    }
                                    Else
                                    {
                                        If ((_T_0 == One))
                                        {
                                            If ((SDGV == 0xFF))
                                            {
                                                Return (Zero)
                                            }
                                            Else
                                            {
                                                Return (One)
                                            }
                                        }
                                        Else
                                        {
                                            If ((_T_0 == 0x02))
                                            {
                                                Return (SDGV) /* \SDGV */
                                            }
                                        }
                                    }

                                    Break
                                }
                            }

                            Return (Zero)
                        }
                    }

                    Device (PR18)
                    {
                        Name (_ADR, 0x08)  // _ADR: Address
                        Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
                        {
                            0xFF, 
                            0xFF, 
                            Zero, 
                            Zero
                        })
                        Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
                        {
                            ToPLD (
                                PLD_Revision       = 0x1,
                                PLD_IgnoreColor    = 0x1,
                                PLD_Red            = 0x0,
                                PLD_Green          = 0x0,
                                PLD_Blue           = 0x0,
                                PLD_Width          = 0x0,
                                PLD_Height         = 0x0,
                                PLD_UserVisible    = 0x1,
                                PLD_Dock           = 0x0,
                                PLD_Lid            = 0x0,
                                PLD_Panel          = "UNKNOWN",
                                PLD_VerticalPosition = "LOWER",
                                PLD_HorizontalPosition = "RIGHT",
                                PLD_Shape          = "UNKNOWN",
                                PLD_GroupOrientation = 0x0,
                                PLD_GroupToken     = 0x0,
                                PLD_GroupPosition  = 0x0,
                                PLD_Bay            = 0x0,
                                PLD_Ejectable      = 0x0,
                                PLD_EjectRequired  = 0x0,
                                PLD_CabinetNumber  = 0x0,
                                PLD_CardCageNumber = 0x0,
                                PLD_Reference      = 0x0,
                                PLD_Rotation       = 0x0,
                                PLD_Order          = 0x0,
                                PLD_VerticalOffset = 0x0,
                                PLD_HorizontalOffset = 0x0)

                        })
                    }
                }
            }

            Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
            {
                0x0D, 
                0x03
            })
            Name (_S0W, 0x03)  // _S0W: S0 Device Wake State
            OperationRegion (USBR, PCI_Config, 0x54, 0x04)
            Field (USBR, WordAcc, NoLock, Preserve)
            {
                Offset (0x01), 
                PMEE,   1, 
                    ,   6, 
                PMES,   1
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((XHCI == Zero))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (Zero)
                }
            }

            Method (_DSW, 3, NotSerialized)  // _DSW: Device Sleep Wake
            {
            }

            Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
            {
                Return (Zero)
            }

            Method (_PR3, 0, NotSerialized)  // _PR3: Power Resources for D3hot
            {
                Return (Package (0x01)
                {
                    USBC
                })
            }
        }

        Device (SEC0)
        {
            Name (_ADR, 0x001A0000)  // _ADR: Address
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (_S0W, 0x03)  // _S0W: S0 Device Wake State
            OperationRegion (PMEB, PCI_Config, 0x84, 0x04)
            Field (PMEB, WordAcc, NoLock, Preserve)
            {
                Offset (0x01), 
                PMEE,   1, 
                    ,   6, 
                PMES,   1
            }

            Method (_DSW, 3, NotSerialized)  // _DSW: Device Sleep Wake
            {
            }
        }
    }

    Scope (_SB.PCI0)
    {
        Device (GFX0)
        {
            Name (_ADR, 0x00020000)  // _ADR: Address
            Name (_DEP, Package (0x03)  // _DEP: Dependencies
            {
                PEPD, 
                I2C7, 
                ^^I2C7.PMIC
            })
            Name (PDEP, Package (0x01)
            {
                PEPD
            })
            Name (_S0W, 0x03)  // _S0W: S0 Device Wake State
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (SBUF, ResourceTemplate ()
                {
                    I2cSerialBus (0x002C, ControllerInitiated, 0x000186A0,
                        AddressingMode7Bit, "\\_SB.I2C3",
                        0x00, ResourceConsumer, ,
                        )
                })
                Return (SBUF) /* \_SB_.PCI0.GFX0._CRS.SBUF */
            }

            Method (_DOS, 1, NotSerialized)  // _DOS: Disable Output Switching
            {
                DSEN = (Arg0 & 0x07)
            }

            Method (_DOD, 0, NotSerialized)  // _DOD: Display Output Devices
            {
                NDID = Zero
                If ((DIDL != Zero))
                {
                    DID1 = SDDL (DIDL)
                }

                If ((DDL2 != Zero))
                {
                    DID2 = SDDL (DDL2)
                }

                If ((DDL3 != Zero))
                {
                    DID3 = SDDL (DDL3)
                }

                If ((DDL4 != Zero))
                {
                    DID4 = SDDL (DDL4)
                }

                If ((DDL5 != Zero))
                {
                    DID5 = SDDL (DDL5)
                }

                If ((NDID == One))
                {
                    Name (TMP1, Package (0x02)
                    {
                        0xFFFFFFFF, 
                        0xFFFFFFFF
                    })
                    Index (TMP1, Zero) = (0x00010000 | DID1)
                    If ((SOCS < 0x02))
                    {
                        Index (TMP1, One) = 0x00020F39
                    }
                    Else
                    {
                        Index (TMP1, One) = 0x00020F38
                    }

                    Return (TMP1) /* \_SB_.PCI0.GFX0._DOD.TMP1 */
                }

                If ((NDID == 0x02))
                {
                    Name (TMP2, Package (0x03)
                    {
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF
                    })
                    Index (TMP2, Zero) = (0x00010000 | DID1)
                    Index (TMP2, One) = (0x00010000 | DID2)
                    If ((SOCS < 0x02))
                    {
                        Index (TMP2, 0x02) = 0x00020F39
                    }
                    Else
                    {
                        Index (TMP2, 0x02) = 0x00020F38
                    }

                    Return (TMP2) /* \_SB_.PCI0.GFX0._DOD.TMP2 */
                }

                If ((NDID == 0x03))
                {
                    Name (TMP3, Package (0x04)
                    {
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF
                    })
                    Index (TMP3, Zero) = (0x00010000 | DID1)
                    Index (TMP3, One) = (0x00010000 | DID2)
                    Index (TMP3, 0x02) = (0x00010000 | DID3)
                    If ((SOCS < 0x02))
                    {
                        Index (TMP3, 0x03) = 0x00020F39
                    }
                    Else
                    {
                        Index (TMP3, 0x03) = 0x00020F38
                    }

                    Return (TMP3) /* \_SB_.PCI0.GFX0._DOD.TMP3 */
                }

                If ((NDID == 0x04))
                {
                    Name (TMP4, Package (0x05)
                    {
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF
                    })
                    Index (TMP4, Zero) = (0x00010000 | DID1)
                    Index (TMP4, One) = (0x00010000 | DID2)
                    Index (TMP4, 0x02) = (0x00010000 | DID3)
                    Index (TMP4, 0x03) = (0x00010000 | DID4)
                    If ((SOCS < 0x02))
                    {
                        Index (TMP4, 0x04) = 0x00020F39
                    }
                    Else
                    {
                        Index (TMP4, 0x04) = 0x00020F38
                    }

                    Return (TMP4) /* \_SB_.PCI0.GFX0._DOD.TMP4 */
                }

                If ((NDID > 0x04))
                {
                    Name (TMP5, Package (0x06)
                    {
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF, 
                        0xFFFFFFFF
                    })
                    Index (TMP5, Zero) = (0x00010000 | DID1)
                    Index (TMP5, One) = (0x00010000 | DID2)
                    Index (TMP5, 0x02) = (0x00010000 | DID3)
                    Index (TMP5, 0x03) = (0x00010000 | DID4)
                    Index (TMP5, 0x04) = (0x00010000 | DID5)
                    If ((SOCS < 0x02))
                    {
                        Index (TMP5, 0x05) = 0x00020F39
                    }
                    Else
                    {
                        Index (TMP5, 0x05) = 0x00020F38
                    }

                    Return (TMP5) /* \_SB_.PCI0.GFX0._DOD.TMP5 */
                }

                If ((SOCS < 0x02))
                {
                    Return (Package (0x02)
                    {
                        0x0400, 
                        0x00020F39
                    })
                }
                Else
                {
                    Return (Package (0x02)
                    {
                        0x0400, 
                        0x00020F38
                    })
                }
            }

            Device (DD01)
            {
                Method (_ADR, 0, Serialized)  // _ADR: Address
                {
                    If (((0x0F00 & DID1) == 0x0400))
                    {
                        EDPV = One
                        DIDX = DID1 /* \DID1 */
                        Return (One)
                    }

                    If ((DID1 == Zero))
                    {
                        Return (One)
                    }
                    Else
                    {
                        Return ((0xFFFF & DID1))
                    }
                }

                Method (_DCS, 0, NotSerialized)  // _DCS: Display Current Status
                {
                    Return (CDDS (DID1))
                }

                Method (_DGS, 0, NotSerialized)  // _DGS: Display Graphics State
                {
                    Return (NDDS (DID1))
                }

                Method (_DSS, 1, NotSerialized)  // _DSS: Device Set State
                {
                    If (((Arg0 & 0xC0000000) == 0xC0000000))
                    {
                        CSTE = NSTE /* \NSTE */
                    }
                }
            }

            Device (DD02)
            {
                Method (_ADR, 0, Serialized)  // _ADR: Address
                {
                    If (((0x0F00 & DID2) == 0x0400))
                    {
                        EDPV = 0x02
                        DIDX = DID2 /* \DID2 */
                        Return (0x02)
                    }

                    If ((DID2 == Zero))
                    {
                        Return (0x02)
                    }
                    Else
                    {
                        Return ((0xFFFF & DID2))
                    }
                }

                Method (_DCS, 0, NotSerialized)  // _DCS: Display Current Status
                {
                    Return (CDDS (DID2))
                }

                Method (_DGS, 0, NotSerialized)  // _DGS: Display Graphics State
                {
                    Return (NDDS (DID2))
                }

                Method (_DSS, 1, NotSerialized)  // _DSS: Device Set State
                {
                    If (((Arg0 & 0xC0000000) == 0xC0000000))
                    {
                        CSTE = NSTE /* \NSTE */
                    }
                }
            }

            Device (DD03)
            {
                Method (_ADR, 0, Serialized)  // _ADR: Address
                {
                    If (((0x0F00 & DID3) == 0x0400))
                    {
                        EDPV = 0x03
                        DIDX = DID3 /* \DID3 */
                        Return (0x03)
                    }

                    If ((DID3 == Zero))
                    {
                        Return (0x03)
                    }
                    Else
                    {
                        Return ((0xFFFF & DID3))
                    }
                }

                Method (_DCS, 0, NotSerialized)  // _DCS: Display Current Status
                {
                    If ((DID3 == Zero))
                    {
                        Return (0x0B)
                    }
                    Else
                    {
                        Return (CDDS (DID3))
                    }
                }

                Method (_DGS, 0, NotSerialized)  // _DGS: Display Graphics State
                {
                    Return (NDDS (DID3))
                }

                Method (_DSS, 1, NotSerialized)  // _DSS: Device Set State
                {
                    If (((Arg0 & 0xC0000000) == 0xC0000000))
                    {
                        CSTE = NSTE /* \NSTE */
                    }
                }
            }

            Device (DD04)
            {
                Method (_ADR, 0, Serialized)  // _ADR: Address
                {
                    If (((0x0F00 & DID4) == 0x0400))
                    {
                        EDPV = 0x04
                        DIDX = DID4 /* \DID4 */
                        Return (0x04)
                    }

                    If ((DID4 == Zero))
                    {
                        Return (0x04)
                    }
                    Else
                    {
                        Return ((0xFFFF & DID4))
                    }
                }

                Method (_DCS, 0, NotSerialized)  // _DCS: Display Current Status
                {
                    If ((DID4 == Zero))
                    {
                        Return (0x0B)
                    }
                    Else
                    {
                        Return (CDDS (DID4))
                    }
                }

                Method (_DGS, 0, NotSerialized)  // _DGS: Display Graphics State
                {
                    Return (NDDS (DID4))
                }

                Method (_DSS, 1, NotSerialized)  // _DSS: Device Set State
                {
                    If (((Arg0 & 0xC0000000) == 0xC0000000))
                    {
                        CSTE = NSTE /* \NSTE */
                    }
                }
            }

            Device (DD05)
            {
                Method (_ADR, 0, Serialized)  // _ADR: Address
                {
                    If (((0x0F00 & DID5) == 0x0400))
                    {
                        EDPV = 0x05
                        DIDX = DID5 /* \DID5 */
                        Return (0x05)
                    }

                    If ((DID5 == Zero))
                    {
                        Return (0x05)
                    }
                    Else
                    {
                        Return ((0xFFFF & DID5))
                    }
                }

                Method (_DCS, 0, NotSerialized)  // _DCS: Display Current Status
                {
                    If ((DID5 == Zero))
                    {
                        Return (0x0B)
                    }
                    Else
                    {
                        Return (CDDS (DID5))
                    }
                }

                Method (_DGS, 0, NotSerialized)  // _DGS: Display Graphics State
                {
                    Return (NDDS (DID5))
                }

                Method (_DSS, 1, NotSerialized)  // _DSS: Device Set State
                {
                    If (((Arg0 & 0xC0000000) == 0xC0000000))
                    {
                        CSTE = NSTE /* \NSTE */
                    }
                }
            }

            Device (DD06)
            {
                Method (_ADR, 0, Serialized)  // _ADR: Address
                {
                    If (((0x0F00 & DID6) == 0x0400))
                    {
                        EDPV = 0x06
                        DIDX = DID6 /* \DID6 */
                        Return (0x06)
                    }

                    If ((DID6 == Zero))
                    {
                        Return (0x06)
                    }
                    Else
                    {
                        Return ((0xFFFF & DID6))
                    }
                }

                Method (_DCS, 0, NotSerialized)  // _DCS: Display Current Status
                {
                    If ((DID6 == Zero))
                    {
                        Return (0x0B)
                    }
                    Else
                    {
                        Return (CDDS (DID6))
                    }
                }

                Method (_DGS, 0, NotSerialized)  // _DGS: Display Graphics State
                {
                    Return (NDDS (DID6))
                }

                Method (_DSS, 1, NotSerialized)  // _DSS: Device Set State
                {
                    If (((Arg0 & 0xC0000000) == 0xC0000000))
                    {
                        CSTE = NSTE /* \NSTE */
                    }
                }
            }

            Device (DD07)
            {
                Method (_ADR, 0, Serialized)  // _ADR: Address
                {
                    If (((0x0F00 & DID7) == 0x0400))
                    {
                        EDPV = 0x07
                        DIDX = DID7 /* \DID7 */
                        Return (0x07)
                    }

                    If ((DID7 == Zero))
                    {
                        Return (0x07)
                    }
                    Else
                    {
                        Return ((0xFFFF & DID7))
                    }
                }

                Method (_DCS, 0, NotSerialized)  // _DCS: Display Current Status
                {
                    If ((DID7 == Zero))
                    {
                        Return (0x0B)
                    }
                    Else
                    {
                        Return (CDDS (DID7))
                    }
                }

                Method (_DGS, 0, NotSerialized)  // _DGS: Display Graphics State
                {
                    Return (NDDS (DID7))
                }

                Method (_DSS, 1, NotSerialized)  // _DSS: Device Set State
                {
                    If (((Arg0 & 0xC0000000) == 0xC0000000))
                    {
                        CSTE = NSTE /* \NSTE */
                    }
                }
            }

            Device (DD08)
            {
                Method (_ADR, 0, Serialized)  // _ADR: Address
                {
                    If (((0x0F00 & DID8) == 0x0400))
                    {
                        EDPV = 0x08
                        DIDX = DID8 /* \DID8 */
                        Return (0x08)
                    }

                    If ((DID8 == Zero))
                    {
                        Return (0x08)
                    }
                    Else
                    {
                        Return ((0xFFFF & DID8))
                    }
                }

                Method (_DCS, 0, NotSerialized)  // _DCS: Display Current Status
                {
                    If ((DID8 == Zero))
                    {
                        Return (0x0B)
                    }
                    Else
                    {
                        Return (CDDS (DID8))
                    }
                }

                Method (_DGS, 0, NotSerialized)  // _DGS: Display Graphics State
                {
                    Return (NDDS (DID8))
                }

                Method (_DSS, 1, NotSerialized)  // _DSS: Device Set State
                {
                    If (((Arg0 & 0xC0000000) == 0xC0000000))
                    {
                        CSTE = NSTE /* \NSTE */
                    }
                }
            }

            Device (DD1F)
            {
                Method (_ADR, 0, Serialized)  // _ADR: Address
                {
                    If ((EDPV == Zero))
                    {
                        Return (0x1F)
                    }
                    Else
                    {
                        Return ((0xFFFF & DIDX))
                    }
                }

                Method (_DCS, 0, NotSerialized)  // _DCS: Display Current Status
                {
                    If ((EDPV == Zero))
                    {
                        Return (Zero)
                    }
                    Else
                    {
                        Return (CDDS (DIDX))
                    }
                }

                Method (_DGS, 0, NotSerialized)  // _DGS: Display Graphics State
                {
                    Return (NDDS (DIDX))
                }

                Method (_DSS, 1, NotSerialized)  // _DSS: Device Set State
                {
                    If (((Arg0 & 0xC0000000) == 0xC0000000))
                    {
                        CSTE = NSTE /* \NSTE */
                    }
                }

                Method (_BCL, 0, NotSerialized)  // _BCL: Brightness Control Levels
                {
                    Return (Package (0x67)
                    {
                        0x50, 
                        0x32, 
                        Zero, 
                        One, 
                        0x02, 
                        0x03, 
                        0x04, 
                        0x05, 
                        0x06, 
                        0x07, 
                        0x08, 
                        0x09, 
                        0x0A, 
                        0x0B, 
                        0x0C, 
                        0x0D, 
                        0x0E, 
                        0x0F, 
                        0x10, 
                        0x11, 
                        0x12, 
                        0x13, 
                        0x14, 
                        0x15, 
                        0x16, 
                        0x17, 
                        0x18, 
                        0x19, 
                        0x1A, 
                        0x1B, 
                        0x1C, 
                        0x1D, 
                        0x1E, 
                        0x1F, 
                        0x20, 
                        0x21, 
                        0x22, 
                        0x23, 
                        0x24, 
                        0x25, 
                        0x26, 
                        0x27, 
                        0x28, 
                        0x29, 
                        0x2A, 
                        0x2B, 
                        0x2C, 
                        0x2D, 
                        0x2E, 
                        0x2F, 
                        0x30, 
                        0x31, 
                        0x32, 
                        0x33, 
                        0x34, 
                        0x35, 
                        0x36, 
                        0x37, 
                        0x38, 
                        0x39, 
                        0x3A, 
                        0x3B, 
                        0x3C, 
                        0x3D, 
                        0x3E, 
                        0x3F, 
                        0x40, 
                        0x41, 
                        0x42, 
                        0x43, 
                        0x44, 
                        0x45, 
                        0x46, 
                        0x47, 
                        0x48, 
                        0x49, 
                        0x4A, 
                        0x4B, 
                        0x4C, 
                        0x4D, 
                        0x4E, 
                        0x4F, 
                        0x50, 
                        0x51, 
                        0x52, 
                        0x53, 
                        0x54, 
                        0x55, 
                        0x56, 
                        0x57, 
                        0x58, 
                        0x59, 
                        0x5A, 
                        0x5B, 
                        0x5C, 
                        0x5D, 
                        0x5E, 
                        0x5F, 
                        0x60, 
                        0x61, 
                        0x62, 
                        0x63, 
                        0x64
                    })
                }

                Method (_BCM, 1, NotSerialized)  // _BCM: Brightness Control Method
                {
                    If (((Arg0 >= Zero) && (Arg0 <= 0x64)))
                    {
                        AINT (One, Arg0)
                        BRTL = Arg0
                    }
                }

                Method (_BQC, 0, NotSerialized)  // _BQC: Brightness Query Current
                {
                    Return (BRTL) /* \BRTL */
                }
            }

            Method (SDDL, 1, NotSerialized)
            {
                NDID++
                Local0 = (Arg0 & 0x0F0F)
                Local1 = (0x80000000 | Local0)
                If ((DIDL == Local0))
                {
                    Return (Local1)
                }

                If ((DDL2 == Local0))
                {
                    Return (Local1)
                }

                If ((DDL3 == Local0))
                {
                    Return (Local1)
                }

                If ((DDL4 == Local0))
                {
                    Return (Local1)
                }

                If ((DDL5 == Local0))
                {
                    Return (Local1)
                }

                If ((DDL6 == Local0))
                {
                    Return (Local1)
                }

                If ((DDL7 == Local0))
                {
                    Return (Local1)
                }

                If ((DDL8 == Local0))
                {
                    Return (Local1)
                }

                Return (Zero)
            }

            Method (CDDS, 1, NotSerialized)
            {
                Local0 = (Arg0 & 0x0F0F)
                If ((Zero == Local0))
                {
                    Return (0x1D)
                }

                If ((CADL == Local0))
                {
                    Return (0x1F)
                }

                If ((CAL2 == Local0))
                {
                    Return (0x1F)
                }

                If ((CAL3 == Local0))
                {
                    Return (0x1F)
                }

                If ((CAL4 == Local0))
                {
                    Return (0x1F)
                }

                If ((CAL5 == Local0))
                {
                    Return (0x1F)
                }

                If ((CAL6 == Local0))
                {
                    Return (0x1F)
                }

                If ((CAL7 == Local0))
                {
                    Return (0x1F)
                }

                If ((CAL8 == Local0))
                {
                    Return (0x1F)
                }

                Return (0x1D)
            }

            Method (NDDS, 1, NotSerialized)
            {
                Local0 = (Arg0 & 0x0F0F)
                If ((Zero == Local0))
                {
                    Return (Zero)
                }

                If ((NADL == Local0))
                {
                    Return (One)
                }

                If ((NDL2 == Local0))
                {
                    Return (One)
                }

                If ((NDL3 == Local0))
                {
                    Return (One)
                }

                If ((NDL4 == Local0))
                {
                    Return (One)
                }

                If ((NDL5 == Local0))
                {
                    Return (One)
                }

                If ((NDL6 == Local0))
                {
                    Return (One)
                }

                If ((NDL7 == Local0))
                {
                    Return (One)
                }

                If ((NDL8 == Local0))
                {
                    Return (One)
                }

                Return (Zero)
            }

            OperationRegion (IGDP, PCI_Config, Zero, 0x0100)
            Field (IGDP, AnyAcc, NoLock, Preserve)
            {
                Offset (0x10), 
                MADR,   32, 
                Offset (0x50), 
                    ,   1, 
                GIVD,   1, 
                    ,   1, 
                GUMA,   5, 
                Offset (0x52), 
                Offset (0x54), 
                    ,   4, 
                GMFN,   1, 
                Offset (0x58), 
                Offset (0x5C), 
                GSTM,   32, 
                Offset (0xE0), 
                GSSE,   1, 
                GSSB,   14, 
                GSES,   1, 
                Offset (0xE4), 
                ASLE,   8, 
                Offset (0xE8), 
                Offset (0xFC), 
                ASLS,   32
            }

            OperationRegion (IGMM, SystemMemory, MADR, 0x3000)
            Field (IGMM, AnyAcc, NoLock, Preserve)
            {
                Offset (0x20C8), 
                    ,   4, 
                DCFE,   4
            }

            OperationRegion (IGDM, SystemMemory, ASLB, 0x2000)
            Field (IGDM, AnyAcc, NoLock, Preserve)
            {
                SIGN,   128, 
                SIZE,   32, 
                OVER,   32, 
                SVER,   256, 
                VVER,   128, 
                GVER,   128, 
                MBOX,   32, 
                DMOD,   32, 
                Offset (0x100), 
                DRDY,   32, 
                CSTS,   32, 
                CEVT,   32, 
                Offset (0x120), 
                DIDL,   32, 
                DDL2,   32, 
                DDL3,   32, 
                DDL4,   32, 
                DDL5,   32, 
                DDL6,   32, 
                DDL7,   32, 
                DDL8,   32, 
                CPDL,   32, 
                CPL2,   32, 
                CPL3,   32, 
                CPL4,   32, 
                CPL5,   32, 
                CPL6,   32, 
                CPL7,   32, 
                CPL8,   32, 
                CAD1,   32, 
                CAL2,   32, 
                CAL3,   32, 
                CAL4,   32, 
                CAL5,   32, 
                CAL6,   32, 
                CAL7,   32, 
                CAL8,   32, 
                NADL,   32, 
                NDL2,   32, 
                NDL3,   32, 
                NDL4,   32, 
                NDL5,   32, 
                NDL6,   32, 
                NDL7,   32, 
                NDL8,   32, 
                ASLP,   32, 
                TIDX,   32, 
                CHPD,   32, 
                CLID,   32, 
                CDCK,   32, 
                SXSW,   32, 
                EVTS,   32, 
                CNOT,   32, 
                NRDY,   32, 
                Offset (0x200), 
                SCIE,   1, 
                GEFC,   4, 
                GXFC,   3, 
                GESF,   8, 
                Offset (0x204), 
                PARM,   32, 
                DSLP,   32, 
                Offset (0x300), 
                ARDY,   32, 
                ASLC,   32, 
                TCHE,   32, 
                ALSI,   32, 
                BCLP,   32, 
                PFIT,   32, 
                CBLV,   32, 
                BCLM,   320, 
                CPFM,   32, 
                EPFM,   32, 
                PLUT,   592, 
                PFMB,   32, 
                CCDV,   32, 
                PCFT,   32, 
                Offset (0x400), 
                GVD1,   49152, 
                PHED,   32, 
                BDDC,   2048
            }

            Name (DBTB, Package (0x15)
            {
                Zero, 
                0x07, 
                0x38, 
                0x01C0, 
                0x0E00, 
                0x3F, 
                0x01C7, 
                0x0E07, 
                0x01F8, 
                0x0E38, 
                0x0FC0, 
                Zero, 
                Zero, 
                Zero, 
                Zero, 
                Zero, 
                0x7000, 
                0x7007, 
                0x7038, 
                0x71C0, 
                0x7E00
            })
            Name (CDCT, Package (0x06)
            {
                Package (0x01)
                {
                    0xA0
                }, 

                Package (0x01)
                {
                    0xC8
                }, 

                Package (0x01)
                {
                    0x010B
                }, 

                Package (0x01)
                {
                    0x0140
                }, 

                Package (0x01)
                {
                    0x0164
                }, 

                Package (0x01)
                {
                    0x0190
                }
            })
            Name (SUCC, One)
            Name (NVLD, 0x02)
            Name (CRIT, 0x04)
            Name (NCRT, 0x06)
            Method (GSCI, 0, Serialized)
            {
                Method (GBDA, 0, Serialized)
                {
                    If ((GESF == Zero))
                    {
                        PARM = 0x0279
                        GESF = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == One))
                    {
                        PARM = 0x0240
                        GESF = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x04))
                    {
                        PARM &= 0xEFFF0000
                        PARM &= (DerefOf (Index (DBTB, IBTT)) << 0x10)
                        PARM |= IBTT /* \_SB_.PCI0.GFX0.PARM */
                        GESF = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x05))
                    {
                        PARM = IPSC /* \IPSC */
                        PARM |= (IPAT << 0x08)
                        PARM += 0x0100
                        PARM |= (LIDS << 0x10)
                        PARM += 0x00010000
                        PARM |= (IBLC << 0x12)
                        PARM |= (IBIA << 0x14)
                        GESF = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x06))
                    {
                        PARM = ITVF /* \ITVF */
                        PARM |= (ITVM << 0x04)
                        GESF = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x07))
                    {
                        PARM = GIVD /* \_SB_.PCI0.GFX0.GIVD */
                        PARM ^= One
                        PARM |= (GMFN << One)
                        PARM |= 0x1800
                        PARM |= (IDMS << 0x11)
                        PARM |= (DerefOf (Index (CDCT, DCFE)) << 0x15) /* \_SB_.PCI0.GFX0.PARM */
                        GESF = One
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x0A))
                    {
                        PARM = Zero
                        If (ISSC)
                        {
                            PARM |= 0x03
                        }

                        GESF = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    GESF = Zero
                    Return (CRIT) /* \_SB_.PCI0.GFX0.CRIT */
                }

                Method (SBCB, 0, Serialized)
                {
                    If ((GESF == Zero))
                    {
                        PARM = Zero
                        If ((PFLV == FMBL))
                        {
                            PARM = 0x000F87FD
                        }

                        If ((PFLV == FDTP))
                        {
                            PARM = 0x000F87BD
                        }

                        GESF = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == One))
                    {
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x03))
                    {
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x04))
                    {
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x05))
                    {
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x06))
                    {
                        ITVF = (PARM & 0x0F)
                        ITVM = ((PARM & 0xF0) >> 0x04)
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x07))
                    {
                        If ((PARM == Zero))
                        {
                            Local0 = CLID /* \_SB_.PCI0.GFX0.CLID */
                            If ((0x80000000 & Local0))
                            {
                                CLID &= 0x0F
                                GLID (CLID)
                            }
                        }

                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x08))
                    {
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x09))
                    {
                        IBTT = (PARM & 0xFF)
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x0A))
                    {
                        IPSC = (PARM & 0xFF)
                        If (((PARM >> 0x08) & 0xFF))
                        {
                            IPAT = ((PARM >> 0x08) & 0xFF)
                            IPAT--
                        }

                        IBLC = ((PARM >> 0x12) & 0x03)
                        IBIA = ((PARM >> 0x14) & 0x07)
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x0B))
                    {
                        IF1E = ((PARM >> One) & One)
                        IDMS = ((PARM >> 0x11) & 0x0F)
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x10))
                    {
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x11))
                    {
                        PARM = (LIDS << 0x08)
                        PARM += 0x0100
                        GESF = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x12))
                    {
                        If ((PARM & One))
                        {
                            If (((PARM >> One) == One))
                            {
                                ISSC = One
                            }
                            Else
                            {
                                GESF = Zero
                                Return (CRIT) /* \_SB_.PCI0.GFX0.CRIT */
                            }
                        }
                        Else
                        {
                            ISSC = Zero
                        }

                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x13))
                    {
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    If ((GESF == 0x14))
                    {
                        PAVP = (PARM & 0x0F)
                        GESF = Zero
                        PARM = Zero
                        Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                    }

                    GESF = Zero
                    Return (SUCC) /* \_SB_.PCI0.GFX0.SUCC */
                }

                If ((GEFC == 0x04))
                {
                    GXFC = GBDA ()
                }

                If ((GEFC == 0x06))
                {
                    GXFC = SBCB ()
                }

                GEFC = Zero
                SCIS = One
                GSSE = Zero
                SCIE = Zero
                Return (Zero)
            }

            Method (PDRD, 0, NotSerialized)
            {
                If (!DRDY)
                {
                    Sleep (ASLP)
                }

                Return (!DRDY)
            }

            Method (PSTS, 0, NotSerialized)
            {
                If ((CSTS > 0x02))
                {
                    Sleep (ASLP)
                }

                Return ((CSTS == 0x03))
            }

            Method (GNOT, 2, NotSerialized)
            {
                If (PDRD ())
                {
                    Return (One)
                }

                CEVT = Arg0
                CSTS = 0x03
                If (((CHPD == Zero) && (Arg1 == Zero)))
                {
                    If (((OSYS > 0x07D0) || (OSYS < 0x07D6)))
                    {
                        Notify (PCI0, Arg1)
                    }
                    Else
                    {
                        Notify (GFX0, Arg1)
                    }
                }

                Notify (GFX0, 0x80) // Status Change
                Return (Zero)
            }

            Method (GHDS, 1, NotSerialized)
            {
                TIDX = Arg0
                Return (GNOT (One, Zero))
            }

            Method (GLID, 1, NotSerialized)
            {
                CLID = Arg0
                Return (GNOT (0x02, Zero))
            }

            Method (GDCK, 1, NotSerialized)
            {
                CDCK = Arg0
                Return (GNOT (0x04, Zero))
            }

            Method (PARD, 0, NotSerialized)
            {
                If (!ARDY)
                {
                    Sleep (ASLP)
                }

                Return (!ARDY)
            }

            Method (AINT, 2, NotSerialized)
            {
                If (!(TCHE & (One << Arg0)))
                {
                    Return (One)
                }

                If (PARD ())
                {
                    Return (One)
                }

                If ((Arg0 == 0x02))
                {
                    If (CPFM)
                    {
                        Local0 = (CPFM & 0x0F)
                        Local1 = (EPFM & 0x0F)
                        If ((Local0 == One))
                        {
                            If ((Local1 & 0x06))
                            {
                                PFIT = 0x06
                            }
                            Else
                            {
                                If ((Local1 & 0x08))
                                {
                                    PFIT = 0x08
                                }
                                Else
                                {
                                    PFIT = One
                                }
                            }
                        }

                        If ((Local0 == 0x06))
                        {
                            If ((Local1 & 0x08))
                            {
                                PFIT = 0x08
                            }
                            Else
                            {
                                If ((Local1 & One))
                                {
                                    PFIT = One
                                }
                                Else
                                {
                                    PFIT = 0x06
                                }
                            }
                        }

                        If ((Local0 == 0x08))
                        {
                            If ((Local1 & One))
                            {
                                PFIT = One
                            }
                            Else
                            {
                                If ((Local1 & 0x06))
                                {
                                    PFIT = 0x06
                                }
                                Else
                                {
                                    PFIT = 0x08
                                }
                            }
                        }
                    }
                    Else
                    {
                        PFIT ^= 0x07
                    }

                    PFIT |= 0x80000000
                    ASLC = 0x04
                }
                Else
                {
                    If ((Arg0 == One))
                    {
                        BCLP = ((Arg1 * 0xFF) / 0x64)
                        BCLP |= 0x80000000
                        ASLC = 0x02
                    }
                    Else
                    {
                        If ((Arg0 == Zero))
                        {
                            ALSI = Arg1
                            ASLC = One
                        }
                        Else
                        {
                            Return (One)
                        }
                    }
                }

                ASLE = One
                Return (Zero)
            }

            Method (SCIP, 0, NotSerialized)
            {
                If ((OVER != Zero))
                {
                    Return (!GSMI)
                }

                Return (Zero)
            }

            Device (ISP0)
            {
                Name (_ADR, 0x0F38)  // _ADR: Address
                Name (_DDN, "VLV2 ISP - 80860F38")  // _DDN: DOS Device Name
                Name (_UID, One)  // _UID: Unique ID
                Name (_DEP, Package (0x01)  // _DEP: Dependencies
                {
                    PEPD
                })
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If ((SOCS >= 0x02))
                    {
                        If ((ISPD == One))
                        {
                            Return (0x0F)
                        }
                        Else
                        {
                            Return (Zero)
                        }
                    }
                    Else
                    {
                        _ADR = 0x0F39
                        _DDN = "VLV2 ISP - 80860F39"
                        If ((ISPD == One))
                        {
                            Return (0x0F)
                        }
                        Else
                        {
                            Return (Zero)
                        }
                    }
                }

                Name (SBUF, ResourceTemplate ()
                {
                    Memory32Fixed (ReadWrite,
                        0x90C00000,         // Address Base
                        0x00400000,         // Address Length
                        )
                })
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Return (SBUF) /* \_SB_.PCI0.GFX0.ISP0.SBUF */
                }

                Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                {
                }

                Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                {
                }

                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If ((Arg0 == One))
                    {
                        Return (One)
                    }
                    Else
                    {
                        If ((Arg0 == 0x02))
                        {
                            Return (0x02)
                        }
                        Else
                        {
                            Return (0x0F)
                        }
                    }
                }
            }
        }
    }

    Scope (_PR)
    {
        Processor (CPU0, 0x01, 0x00000000, 0x00) {}
        Processor (CPU1, 0x02, 0x00000000, 0x00) {}
        Processor (CPU2, 0x03, 0x00000000, 0x00) {}
        Processor (CPU3, 0x04, 0x00000000, 0x00) {}
    }

    Mutex (MUTX, 0x00)
    OperationRegion (PRT0, SystemIO, 0x80, 0x04)
    Field (PRT0, DWordAcc, Lock, Preserve)
    {
        P80H,   32
    }

    Method (P8XH, 2, Serialized)
    {
        If ((Arg0 == Zero))
        {
            P80D = ((P80D & 0xFFFFFF00) | Arg1)
        }

        If ((Arg0 == One))
        {
            P80D = ((P80D & 0xFFFF00FF) | (Arg1 << 0x08))
        }

        If ((Arg0 == 0x02))
        {
            P80D = ((P80D & 0xFF00FFFF) | (Arg1 << 0x10))
        }

        If ((Arg0 == 0x03))
        {
            P80D = ((P80D & 0x00FFFFFF) | (Arg1 << 0x18))
        }

        P80H = P80D /* \P80D */
    }

    OperationRegion (SPRT, SystemIO, 0xB2, 0x02)
    Field (SPRT, ByteAcc, Lock, Preserve)
    {
        SSMP,   8
    }

    Method (_PIC, 1, NotSerialized)  // _PIC: Interrupt Model
    {
        GPIC = Arg0
        PICM = Arg0
    }

    OperationRegion (SWC0, SystemIO, 0x0610, 0x0F)
    Field (SWC0, ByteAcc, NoLock, Preserve)
    {
        G1S,    8, 
        Offset (0x04), 
        G1E,    8, 
        Offset (0x0A), 
        G1S2,   8, 
        G1S3,   8
    }

    OperationRegion (SWC1, SystemIO, PMBS, 0x2C)
    Field (SWC1, DWordAcc, NoLock, Preserve)
    {
        Offset (0x20), 
        G0S,    32, 
        Offset (0x28), 
        G0EN,   32
    }

    Method (_PTS, 1, NotSerialized)  // _PTS: Prepare To Sleep
    {
        P80D = Zero
        P8XH (Zero, Arg0)
        G1S3 = Ones
        G1S2 = Ones
        G1S = One
        G1E = One
        G0S = Ones
        If (CondRefOf (TCGM))
        {
            \_SB.PCI0.LPCB.TPM.PTS (Arg0)
        }

        If (((Arg0 == 0x04) || (Arg0 == 0x05)))
        {
            \_SB.SPI1.AUDI.CLKD ()
        }
    }

    Method (_WAK, 1, Serialized)  // _WAK: Wake
    {
        P8XH (One, 0xAB)
        If (NEXP)
        {
            If ((OSCC & 0x02))
            {
                \_SB.PCI0.NHPG ()
            }

            If ((OSCC & 0x04))
            {
                \_SB.PCI0.NPME ()
            }
        }

        If (((Arg0 == 0x03) || (Arg0 == 0x04)))
        {
            If ((PFLV == FMBL))
            {
                If ((Arg0 == 0x04))
                {
                    PNOT ()
                }
            }

            If ((CFGD & 0x01000000)) {}
            If ((OSYS == 0x07D2))
            {
                If ((CFGD & One))
                {
                    If ((\_PR.CPU0._PPC > Zero))
                    {
                        \_PR.CPU0._PPC -= One
                        PNOT ()
                        \_PR.CPU0._PPC += One
                        PNOT ()
                    }
                    Else
                    {
                        \_PR.CPU0._PPC += One
                        PNOT ()
                        \_PR.CPU0._PPC -= One
                        PNOT ()
                    }
                }
            }
        }

        Return (Package (0x02)
        {
            Zero, 
            Zero
        })
    }

    Method (PNOT, 0, Serialized)
    {
        If (MPEN)
        {
            If ((PDC0 & 0x08))
            {
                Notify (\_PR.CPU0, 0x80) // Performance Capability Change
                If ((PDC0 & 0x10))
                {
                    Sleep (0x64)
                    Notify (\_PR.CPU0, 0x81) // C-State Change
                }
            }

            If ((PDC1 & 0x08))
            {
                Notify (\_PR.CPU1, 0x80) // Performance Capability Change
                If ((PDC1 & 0x10))
                {
                    Sleep (0x64)
                    Notify (\_PR.CPU1, 0x81) // C-State Change
                }
            }

            If ((PDC2 & 0x08))
            {
                Notify (\_PR.CPU2, 0x80) // Performance Capability Change
                If ((PDC2 & 0x10))
                {
                    Sleep (0x64)
                    Notify (\_PR.CPU2, 0x81) // C-State Change
                }
            }

            If ((PDC3 & 0x08))
            {
                Notify (\_PR.CPU3, 0x80) // Performance Capability Change
                If ((PDC3 & 0x10))
                {
                    Sleep (0x64)
                    Notify (\_PR.CPU3, 0x81) // C-State Change
                }
            }
        }
        Else
        {
            Notify (\_PR.CPU0, 0x80) // Performance Capability Change
            Sleep (0x64)
            Notify (\_PR.CPU0, 0x81) // C-State Change
        }
    }

    Scope (_SB)
    {
        Name (CRTT, 0x6E)
        Name (ACTT, 0x55)
        Name (SCR0, 0x0102)
        Name (SCR1, 0x0102)
        Name (SCR2, 0x0102)
        Name (SCR3, 0x0102)
        Name (GCR0, 0x46)
        Name (GCR1, 0x46)
        Name (GCR2, 0x46)
        Name (GCR3, 0x46)
        Name (GCR4, 0x46)
        Name (PST0, 0x3C)
        Name (PST1, 0x3C)
        Name (PST2, 0x3C)
        Name (PST3, 0x3C)
        Name (PST4, 0x3C)
        Name (LPMV, 0x03)
        Name (PDBG, Zero)
        Name (PDPM, One)
        Name (PDBP, One)
        Name (DLPO, Package (0x06)
        {
            One, 
            One, 
            One, 
            0x19, 
            One, 
            One
        })
        Name (BRQD, Zero)
        Name (PSC1, Zero)
        Name (PSC2, Zero)
        Name (PSC3, Zero)
        Name (PSA1, Zero)
        Name (PSA2, Zero)
        Name (PSA3, Zero)
        Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            CRTT = DPCT /* \DPCT */
            ACTT = DPPT /* \DPPT */
            GCR0 = DGC0 /* \DGC0 */
            GCR1 = DGC1 /* \DGC1 */
            GCR2 = DGC2 /* \DGC2 */
            GCR3 = DGC3 /* \DGC3 */
            GCR4 = DGC4 /* \DGC4 */
            PST0 = DGP0 /* \DGP0 */
            PST1 = DGP1 /* \DGP1 */
            PST2 = DGP2 /* \DGP2 */
            PST3 = DGP3 /* \DGP3 */
            PST4 = DGP4 /* \DGP4 */
            SCR0 = DSC0 /* \DSC0 */
            SCR1 = DSC1 /* \DSC1 */
            SCR2 = DSC2 /* \DSC2 */
            SCR3 = DSC3 /* \DSC3 */
            LPMV = DLPM /* \DLPM */
            PDBG = DDBG /* \DDBG */
            Index (DLPO, One) = LPOE /* \LPOE */
            Index (DLPO, 0x02) = LPPS /* \LPPS */
            Index (DLPO, 0x03) = LPST /* \LPST */
            Index (DLPO, 0x04) = LPPC /* \LPPC */
            Index (DLPO, 0x05) = LPPF /* \LPPF */
            PDPM = DPME /* \DPME */
        }

        Scope (PCI0)
        {
            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                OSYS = 0x07D0
                If (CondRefOf (\_OSI, Local0))
                {
                    If (_OSI ("Windows 2001"))
                    {
                        OSYS = 0x07D1
                    }

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

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

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

                    If (_OSI ("Windows 2009"))
                    {
                        OSYS = 0x07D9
                    }

                    If (_OSI ("Windows 2012"))
                    {
                        OSYS = 0x07DC
                    }

                    If (_OSI ("Windows 2013"))
                    {
                        OSYS = 0x07DD
                    }
                }
            }

            Method (NHPG, 0, Serialized)
            {
            }

            Method (NPME, 0, Serialized)
            {
            }
        }

        Device (GPED)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "INT0002" /* Virtual GPIO Controller */)  // _HID: Hardware ID
            Name (_CID, "INT0002" /* Virtual GPIO Controller */)  // _CID: Compatible ID
            Name (_DDN, "Virtual GPIO controller")  // _DDN: DOS Device Name
            Name (_UID, One)  // _UID: Unique ID
            Name (INST, One)
            Name (XTMP, Zero)
            OperationRegion (SCIS, SystemMemory, 0xFED030C0, 0x04)
            Field (SCIS, DWordAcc, NoLock, Preserve)
            {
                LGBE,   1, 
                LHAD,   1, 
                LATA,   1, 
                LDIO,   1, 
                LARD,   1, 
                LIO1,   1, 
                LCEP,   1, 
                LANB,   1, 
                LHCI,   1, 
                LOTG,   1, 
                LECI,   1, 
                LHSI,   1
            }

            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If ((Arg0 == ToUUID ("8b38b469-6f95-4b08-9b02-2defcc2d2c35")))
                {
                    If ((Arg2 == Zero))
                    {
                        If ((Arg1 == One))
                        {
                            Return (Buffer (One)
                            {
                                 0x03                                             /* . */
                            })
                        }
                    }

                    If ((Arg2 == One))
                    {
                        Return ((PMBS + 0x20))
                    }

                    Return (Zero)
                }
                Else
                {
                    Return (Buffer (One)
                    {
                         0x00                                             /* . */
                    })
                }
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (RBUF, ResourceTemplate ()
                {
                    Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                    {
                        0x00000009,
                    }
                })
                Return (RBUF) /* \_SB_.GPED._CRS.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Method (_AEI, 0, NotSerialized)  // _AEI: ACPI Event Interrupts
            {
                Name (RBUF, ResourceTemplate ()
                {
                    GpioInt (Level, ActiveHigh, ExclusiveAndWake, PullDown, 0x0000,
                        "\\_SB.GPED", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0002
                        }
                })
                Return (RBUF) /* \_SB_.GPED._AEI.RBUF */
            }

            Method (_L02, 0, NotSerialized)  // _Lxx: Level-Triggered GPE
            {
                If ((XHCI == Zero))
                {
                    If ((^^PCI0.EHC1.PMES == One))
                    {
                        ^^PCI0.EHC1.PMEE = Zero
                        Local0 = ^^PCI0.EHC1.PMEE /* \_SB_.PCI0.EHC1.PMEE */
                        Notify (^^PCI0.EHC1, 0x02) // Device Wake
                    }
                }
                Else
                {
                    If ((SOCS > 0x05))
                    {
                        XTMP = (^^PCI0.XHC1.PMCS & 0x8000)
                        If ((XTMP == 0x8000))
                        {
                            Notify (^^PCI0.XHC1, 0x02) // Device Wake
                        }
                    }
                    Else
                    {
                        If ((SOCS > 0x02))
                        {
                            XTMP = (^^PCI0.XHC1.PMCS & 0x8000)
                            If ((XTMP == 0x8000))
                            {
                                ^^PCI0.XHC1.PMCH = 0x81
                                Notify (^^PCI0.XHC1, 0x02) // Device Wake
                            }
                        }
                        Else
                        {
                            XTMP = (^^PCI0.XHC1.PMCS & 0x0103)
                            If ((XTMP == 0x0103))
                            {
                                ^^PCI0.XHC1.PMCS = 0x0100
                                Sleep (0x0A)
                                XTMP = (^^PCI0.XHC1.PMCS & 0x8000)
                                If ((XTMP == 0x8000))
                                {
                                    ^^PCI0.XHC1.PMCH = 0x81
                                }
                                Else
                                {
                                    ^^PCI0.XHC1.PMCS = 0x0103
                                }

                                Sleep (0x0A)
                                Notify (^^PCI0.XHC1, 0x02) // Device Wake
                            }
                            Else
                            {
                                ^^PCI0.XHC1.PMCH = 0x81
                                Sleep (0x0A)
                            }
                        }
                    }
                }

                If ((OTGM != Zero))
                {
                    If ((^^PCI0.OTG1.PMES == One))
                    {
                        ADBG ("OTG wake")
                        ^^PCI0.OTG1.PMEE = Zero
                        ^^PCI0.OTG1.CPME = Zero
                        ^^PCI0.OTG1.U2EN = Zero
                        ^^PCI0.OTG1.U3EN = Zero
                        Notify (^^PCI0.OTG1, 0x02) // Device Wake
                    }
                }

                If ((^^PCI0.SEC0.PMES == One))
                {
                    ^^PCI0.SEC0.PMEE = Zero
                    Local0 = ^^PCI0.SEC0.PMEE /* \_SB_.PCI0.SEC0.PMEE */
                    Notify (^^PCI0.SEC0, 0x02) // Device Wake
                }
            }
        }

        Device (GPO0)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "INT33FC" /* Intel Baytrail GPIO Controller */)  // _HID: Hardware ID
            Name (_CID, "INT33FC" /* Intel Baytrail GPIO Controller */)  // _CID: Compatible ID
            Name (_DDN, "ValleyView General Purpose Input/Output (GPIO) controller")  // _DDN: DOS Device Name
            Name (_UID, One)  // _UID: Unique ID
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (RBUF, ResourceTemplate ()
                {
                    Memory32Fixed (ReadWrite,
                        0xFED0C000,         // Address Base
                        0x00001000,         // Address Length
                        )
                    Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, )
                    {
                        0x00000031,
                    }
                })
                Return (RBUF) /* \_SB_.GPO0._CRS.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Name (AVBL, Zero)
            Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If ((Arg0 == 0x08))
                {
                    AVBL = Arg1
                }
            }

            OperationRegion (GPOP, GeneralPurposeIo, Zero, 0x0C)
            Field (GPOP, ByteAcc, NoLock, Preserve)
            {
                Connection (
                    GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0035
                        }
                ), 
                BTD3,   1, 
                Connection (
                    GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x003A
                        }
                ), 
                SUSB,   1, 
                Connection (
                    GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x003B
                        }
                ), 
                SHD3,   1, 
                Connection (
                    GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x003C
                        }
                ), 
                TCD3,   1
            }
        }

        Device (GPO1)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "INT33FC" /* Intel Baytrail GPIO Controller */)  // _HID: Hardware ID
            Name (_CID, "INT33FC" /* Intel Baytrail GPIO Controller */)  // _CID: Compatible ID
            Name (_DDN, "ValleyView GPNCORE controller")  // _DDN: DOS Device Name
            Name (_UID, 0x02)  // _UID: Unique ID
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (RBUF, ResourceTemplate ()
                {
                    Memory32Fixed (ReadWrite,
                        0xFED0D000,         // Address Base
                        0x00001000,         // Address Length
                        )
                    Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, )
                    {
                        0x00000030,
                    }
                })
                Return (RBUF) /* \_SB_.GPO1._CRS.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }
        }

        Device (GPO2)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "INT33FC" /* Intel Baytrail GPIO Controller */)  // _HID: Hardware ID
            Name (_CID, "INT33FC" /* Intel Baytrail GPIO Controller */)  // _CID: Compatible ID
            Name (_DDN, "ValleyView GPSUS controller")  // _DDN: DOS Device Name
            Name (_UID, 0x03)  // _UID: Unique ID
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (RBUF, ResourceTemplate ()
                {
                    Memory32Fixed (ReadWrite,
                        0xFED0E000,         // Address Base
                        0x00001000,         // Address Length
                        )
                    Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, )
                    {
                        0x00000032,
                    }
                })
                Return (RBUF) /* \_SB_.GPO2._CRS.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Method (_AEI, 0, NotSerialized)  // _AEI: ACPI Event Interrupts
            {
                Name (RBUF, ResourceTemplate ()
                {
                    GpioInt (Level, ActiveLow, ExclusiveAndWake, PullUp, 0x0000,
                        "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0012
                        }
                    GpioInt (Edge, ActiveBoth, ExclusiveAndWake, PullUp, 0x0000,
                        "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x001A
                        }
                })
                Return (RBUF) /* \_SB_.GPO2._AEI.RBUF */
            }

            OperationRegion (GS26, SystemMemory, 0xFED0E168, 0x04)
            Field (GS26, DWordAcc, NoLock, WriteAsZeros)
            {
                HINT,   32
            }

            Method (_E1A, 0, NotSerialized)  // _Exx: Edge-Triggered GPE
            {
                Notify (LID0, 0x80) // Status Change
            }

            Name (BUFF, Buffer (0x07)
            {
                 0xFF                                             /* . */
            })
            CreateByteField (BUFF, Zero, STAT)
            CreateByteField (BUFF, One, LEN)
            CreateByteField (BUFF, 0x02, TMP0)
            CreateByteField (BUFF, 0x03, AX00)
            CreateByteField (BUFF, 0x04, AX01)
            CreateByteField (BUFF, 0x05, AX10)
            CreateByteField (BUFF, 0x06, AX11)
            Method (_L12, 0, NotSerialized)  // _Lxx: Level-Triggered GPE
            {
                Local0 = Zero
                If (CondRefOf (\_SB.I2C1.BATC, Local1))
                {
                    Local0 = ^^I2C1.BATC.INTR ()
                    If ((0xFF == Local0))
                    {
                        ADBG ("INTR RD FAIL")
                        Return (Zero)
                    }

                    If ((Zero == Local0))
                    {
                        Return (Zero)
                    }

                    ADBG ("ULPMC INTR")
                    ADBG (Local0)
                    Notify (ADP1, 0x80) // Status Change
                    Notify (^^I2C1.BATC, 0x80) // Status Change
                    Notify (^^I2C1.BATC, 0x81) // Information Change
                }

                If ((Local0 == 0x0E))
                {
                    Notify (STR3, 0x90) // Device-Specific
                    If ((^^I2C1.AVBL == One))
                    {
                        BUFF = ^^I2C1.THRM /* \_SB_.I2C1.THRM */
                        If ((STAT == Zero))
                        {
                            Local4 = AX01 /* \_SB_.GPO2.AX01 */
                            Local4 &= 0xEF
                            Local5 = AX11 /* \_SB_.GPO2.AX11 */
                            Local5 &= 0xEF
                            AX01 = Local4
                            AX11 = Local5
                            ^^I2C1.THRM = BUFF /* \_SB_.GPO2.BUFF */
                        }
                    }
                }

                If (CondRefOf (\_SB.DPTF, Local3))
                {
                    If (((Local0 == One) || (Local0 == 0x02)))
                    {
                        Notify (DPTF, 0x86) // Device-Specific
                        Notify (TCHG, 0x80) // Status Change
                    }

                    If (((Local0 == 0x07) || (Local0 == 0x08)))
                    {
                        Notify (DPTF, 0x86) // Device-Specific
                        Notify (TCHG, 0x80) // Status Change
                    }
                }
            }

            Name (AVBL, Zero)
            Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If ((Arg0 == 0x08))
                {
                    AVBL = Arg1
                }
            }

            OperationRegion (GPOP, GeneralPurposeIo, Zero, 0x0C)
            Field (GPOP, ByteAcc, NoLock, Preserve)
            {
                Connection (
                    GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0014
                        }
                ), 
                WFD3,   1, 
                Connection (
                    GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0016
                        }
                ), 
                WWD3,   1, 
                Connection (
                    GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x001D
                        }
                ), 
                WWR3,   1
            }
        }

        Device (PEPD)
        {
            Name (_HID, "INT3396" /* Standard Power Management Controller */)  // _HID: Hardware ID
            Name (_CID, EisaId ("PNP0D80") /* Windows-compatible System Power Management Controller */)  // _CID: Compatible ID
            Name (_UID, One)  // _UID: Unique ID
            Name (PEPP, Zero)
            Name (DEVS, Package (0x01)
            {
                Zero
            })
            Name (DEVX, Package (0x12)
            {
                Package (0x02)
                {
                    "\\_SB.PCI0.XHC1", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.PCI0.EHC1", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.PCI0.GFX0", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.PCI0.GFX0.ISP0", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.PCI0.SEC0", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.I2C1", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.I2C2", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.I2C3", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.I2C4", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.I2C5", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.I2C6", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.I2C7", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.SDHA", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.SDHB", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.SDHC", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.SPI1", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.URT1", 
                    One
                }, 

                Package (0x02)
                {
                    "\\_SB.URT2", 
                    One
                }
            })
            Name (CDMP, Package (0x02) {})
            Name (DEVY, Package (0x16)
            {
                Package (0x03)
                {
                    "\\_PR.CPU0", 
                    One, 
                    Package (0x02)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            0xFF, 
                            Zero
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_PR.CPU1", 
                    One, 
                    Package (0x02)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            0xFF, 
                            Zero
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_PR.CPU2", 
                    One, 
                    Package (0x02)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            0xFF, 
                            Zero
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_PR.CPU3", 
                    One, 
                    Package (0x02)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            0xFF, 
                            Zero
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.PCI0.GFX0", 
                    One, 
                    Package (0x02)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            0xFF, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.PCI0.GFX0.ISP0", 
                    One, 
                    Package (0x02)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            0xFF, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.I2C1", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.I2C2", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.I2C3", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.I2C4", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.I2C5", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.I2C6", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.I2C7", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.PCI0.XHC1", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.PCI0.SEC0", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.LPEA", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.SDHA", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.SDHB", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.SDHC", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.SPI1", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.URT1", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }, 

                Package (0x03)
                {
                    "\\_SB.URT2", 
                    One, 
                    Package (0x05)
                    {
                        Zero, 
                        Package (0x02)
                        {
                            Zero, 
                            Zero
                        }, 

                        Package (0x02)
                        {
                            One, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x02, 
                            0x03
                        }, 

                        Package (0x02)
                        {
                            0x03, 
                            0x03
                        }
                    }
                }
            })
            Name (BCCD, Package (0x01)
            {
                Package (0x02)
                {
                    "\\_SB.SDHA", 
                    Package (0x01)
                    {
                        Package (0x03)
                        {
                            Package (0x05)
                            {
                                Zero, 
                                0x20, 
                                Zero, 
                                0x03, 
                                Ones
                            }, 

                            Package (0x03)
                            {
                                0xFFFFFFFC, 
                                Zero, 
                                0x04
                            }, 

                            Zero
                        }
                    }
                }
            })
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
            {
                If ((Arg0 == ToUUID ("b8febfe0-baf8-454b-aecd-49fb91137b21")))
                {
                    If ((Arg2 == Zero))
                    {
                        Return (Buffer (One)
                        {
                             0x0F                                             /* . */
                        })
                    }

                    If ((Arg2 == One))
                    {
                        PEPP = One
                        Return (0x0F)
                    }

                    If ((Arg2 == 0x02))
                    {
                        If ((Arg1 == Zero))
                        {
                            Return (DEVS) /* \_SB_.PEPD.DEVS */
                        }

                        If ((Arg1 == One))
                        {
                            Return (DEVX) /* \_SB_.PEPD.DEVX */
                        }
                    }

                    If ((Arg2 == 0x03))
                    {
                        Index (CDMP, Zero) = "\\_SB.SDHA"
                        Index (CDMP, One) = EM1A /* \EM1A */
                        Return (CDMP) /* \_SB_.PEPD.CDMP */
                    }
                }

                If ((Arg0 == ToUUID ("c4eb40a0-6cd2-11e2-bcfd-0800200c9a66")))
                {
                    If ((Arg2 == Zero))
                    {
                        Return (Buffer (One)
                        {
                             0x07                                             /* . */
                        })
                    }

                    If ((Arg2 == One))
                    {
                        Return (DEVY) /* \_SB_.PEPD.DEVY */
                    }

                    If ((Arg2 == 0x02))
                    {
                        Local0 = EM1A /* \EM1A */
                        Local0 += 0x84
                        Index (DerefOf (Index (DerefOf (Index (DerefOf (Index (DerefOf (Index (BCCD, Zero
                            )), One)), Zero)), Zero)), 0x04) = Local0
                        Return (BCCD) /* \_SB_.PEPD.BCCD */
                    }
                }

                Return (One)
            }
        }

        Device (SDHA)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F14" /* Intel Baytrail SDIO/MMC Host Controller */)  // _HID: Hardware ID
            Name (_CID, "PNP0D40" /* SDA Standard Compliant SD Host Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) eMMC Controller - 80860F14")  // _DDN: DOS Device Name
            Name (_UID, One)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (RBF1, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y07)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000002D,
                }
            })
            Name (RBF2, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y08)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000002C,
                }
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBF1, \_SB.SDHA._Y07._BAS, B0B1)  // _BAS: Base Address
                CreateDWordField (RBF1, \_SB.SDHA._Y07._LEN, B0L1)  // _LEN: Length
                B0B1 = EM0A /* \EM0A */
                B0L1 = EM0L /* \EM0L */
                CreateDWordField (RBF2, \_SB.SDHA._Y08._BAS, B0B2)  // _BAS: Base Address
                CreateDWordField (RBF2, \_SB.SDHA._Y08._LEN, B0L2)  // _LEN: Length
                B0B2 = EM0A /* \EM0A */
                B0L2 = EM0L /* \EM0L */
                If ((EMVR == One))
                {
                    Return (RBF2) /* \_SB_.SDHA.RBF2 */
                }

                Return (RBF1) /* \_SB_.SDHA.RBF1 */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
                If (((SOCS < 0x02) || ((SOCS == 0x02) && (EMVR == One))))
                {
                    Sleep (0x02)
                }
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
                If (((SOCS < 0x02) || ((SOCS == 0x02) && (EMVR == One))))
                {
                    Sleep (0x02)
                }
            }

            OperationRegion (KEYS, SystemMemory, EM1A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }

            Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
            {
            }

            Device (EMMD)
            {
                Name (_ADR, 0x08)  // _ADR: Address
                Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
                {
                    Return (Zero)
                }
            }
        }

        Device (SDHB)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "INT33BB" /* Intel Baytrail SD Host Controller */)  // _HID: Hardware ID
            Name (_CID, "PNP0D40" /* SDA Standard Compliant SD Host Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) SDIO Controller - 80860F15")  // _DDN: DOS Device Name
            Name (_UID, 0x02)  // _UID: Unique ID
            Name (_HRV, 0x02)  // _HRV: Hardware Revision
            Name (_DEP, Package (0x02)  // _DEP: Dependencies
            {
                PEPD, 
                GPO2
            })
            Name (PSTS, Zero)
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y09)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000002E,
                }
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.SDHB._Y09._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.SDHB._Y09._LEN, B0LN)  // _LEN: Length
                B0BA = SI0A /* \SI0A */
                B0LN = SI0L /* \SI0L */
                Return (RBUF) /* \_SB_.SDHB.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((STEP <= 0x04))
                {
                    _HRV = SDMD /* \SDMD */
                }

                If (((SI0A == Zero) || (SD2D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
            {
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
                If ((PSTS == Zero))
                {
                    If ((^^GPO2.AVBL == One))
                    {
                        ^^GPO2.WFD3 = One
                        PSTS = One
                    }
                }
            }

            OperationRegion (KEYS, SystemMemory, SI1A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }

            Device (BRCM)
            {
                Name (_ADR, One)  // _ADR: Address
                Name (_DEP, Package (0x01)  // _DEP: Dependencies
                {
                    GPO2
                })
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
                {
                    Return (Zero)
                }

                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    Zero, 
                    Zero
                })
                Name (_S4W, 0x02)  // _S4W: S4 Device Wake State
                Name (_S0W, 0x02)  // _S0W: S0 Device Wake State
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (RBUF, ResourceTemplate ()
                    {
                        Interrupt (ResourceConsumer, Edge, ActiveHigh, ExclusiveAndWake, ,, )
                        {
                            0x00000049,
                        }
                    })
                    Return (RBUF) /* \_SB_.SDHB.BRCM._CRS.RBUF */
                }

                Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
                {
                    If ((^^^GPO2.AVBL == One))
                    {
                        ^^^GPO2.WFD3 = Zero
                        PSTS = Zero
                    }
                }

                Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
                {
                    If ((PSTS == Zero))
                    {
                        If ((^^^GPO2.AVBL == One))
                        {
                            ^^^GPO2.WFD3 = One
                            PSTS = One
                        }
                    }
                }
            }

            Device (BRC2)
            {
                Name (_ADR, 0x02)  // _ADR: Address
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
                {
                    Return (Zero)
                }

                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (NAM, Buffer (0x0F)
                    {
                        "\\_SB.SDHB.BRCM"
                    })
                    Name (SPB, Buffer (0x0C)
                    {
                        /* 0000 */  0x8E, 0x18, 0x00, 0x01, 0x00, 0xC0, 0x02, 0x00,  /* ........ */
                        /* 0008 */  0x00, 0x01, 0x00, 0x00                           /* .... */
                    })
                    Name (END, ResourceTemplate ()
                    {
                    })
                    Concatenate (SPB, NAM, Local0)
                    Concatenate (Local0, END, Local1)
                    Return (Local1)
                }
            }
        }

        Device (SDHC)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F14" /* Intel Baytrail SDIO/MMC Host Controller */)  // _HID: Hardware ID
            Name (_CID, "PNP0D40" /* SDA Standard Compliant SD Host Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) SD Card Controller - 80860F16")  // _DDN: DOS Device Name
            Name (_UID, 0x03)  // _UID: Unique ID
            Name (_DEP, Package (0x02)  // _DEP: Dependencies
            {
                PEPD, 
                GPO0
            })
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y0A)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000002F,
                }
                GpioInt (Edge, ActiveBoth, SharedAndWake, PullNone, 0x2710,
                    "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0026
                    }
                GpioIo (Shared, PullDefault, 0x0000, 0x0000, IoRestrictionInputOnly,
                    "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0026
                    }
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.SDHC._Y0A._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.SDHC._Y0A._LEN, B0LN)  // _LEN: Length
                B0BA = SD0A /* \SD0A */
                B0LN = SD0L /* \SD0L */
                Return (RBUF) /* \_SB_.SDHC.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((SD0A == Zero) || (SD3D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, SD1A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }
        }

        Device (GDM1)
        {
            Name (_HID, "INTL9C60" /* Intel Baytrail SOC DMA Controller */)  // _HID: Hardware ID
            Name (_DDN, "Intel(R) DMA Controller #1 - INTL9C60")  // _DDN: DOS Device Name
            Name (_UID, One)  // _UID: Unique ID
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00004000,         // Address Length
                    _Y0B)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000002A,
                }
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.GDM1._Y0B._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.GDM1._Y0B._LEN, B0LN)  // _LEN: Length
                B0BA = D10A /* \D10A */
                B0LN = D10L /* \D10L */
                Return (RBUF) /* \_SB_.GDM1.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((D10A == Zero) || (L10D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }
        }

        Device (GDM2)
        {
            Name (_HID, "INTL9C60" /* Intel Baytrail SOC DMA Controller */)  // _HID: Hardware ID
            Name (_DDN, "Intel(R) DMA Controller #2 - INTL9C60")  // _DDN: DOS Device Name
            Name (_UID, 0x02)  // _UID: Unique ID
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00004000,         // Address Length
                    _Y0C)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x0000002B,
                }
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.GDM2._Y0C._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.GDM2._Y0C._LEN, B0LN)  // _LEN: Length
                B0BA = D20A /* \D20A */
                B0LN = D20L /* \D20L */
                Return (RBUF) /* \_SB_.GDM2.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((D20A == Zero) || (L20D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }
        }

        Device (PWM1)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F09" /* Intel PWM Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F09" /* Intel PWM Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) PWM Controller #1 - 80860F08")  // _DDN: DOS Device Name
            Name (_UID, One)  // _UID: Unique ID
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y0D)
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.PWM1._Y0D._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.PWM1._Y0D._LEN, B0LN)  // _LEN: Length
                B0BA = P10A /* \P10A */
                B0LN = P10L /* \P10L */
                Return (RBUF) /* \_SB_.PWM1.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((P10A == Zero) || (L11D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }
        }

        Device (PWM2)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F09" /* Intel PWM Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F09" /* Intel PWM Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) PWM Controller #2 - 80860F09")  // _DDN: DOS Device Name
            Name (_UID, 0x02)  // _UID: Unique ID
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y0E)
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.PWM2._Y0E._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.PWM2._Y0E._LEN, B0LN)  // _LEN: Length
                B0BA = P20A /* \P20A */
                B0LN = P20L /* \P20L */
                Return (RBUF) /* \_SB_.PWM2.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((P20A == Zero) || (L12D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }
        }

        Device (URT1)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F0A" /* Intel Atom UART Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F0A" /* Intel Atom UART Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) HS-UART Controller #1 - 80860F0A")  // _DDN: DOS Device Name
            Name (_UID, One)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y0F)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000027,
                }
                FixedDMA (0x0002, 0x0002, Width32bit, )
                FixedDMA (0x0003, 0x0003, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.URT1._Y0F._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.URT1._Y0F._LEN, B0LN)  // _LEN: Length
                B0BA = U10A /* \U10A */
                B0LN = U10L /* \U10L */
                Return (RBUF) /* \_SB_.URT1.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((U10A == Zero) || (L13D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, U11A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }

            Device (BTH0)
            {
                Name (_HID, "BCM2E84")  // _HID: Hardware ID
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (UBUF, ResourceTemplate ()
                    {
                        UartSerialBus (0x0001C200, DataBitsEight, StopBitsOne,
                            0xFC, LittleEndian, ParityTypeNone, FlowControlNone,
                            0x0020, 0x0020, "\\_SB.URT1",
                            0x00, ResourceConsumer, ,
                            )
                        Interrupt (ResourceConsumer, Edge, ActiveHigh, ExclusiveAndWake, ,, )
                        {
                            0x00000046,
                        }
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0034
                            }
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0035
                            }
                    })
                    Return (UBUF) /* \_SB_.URT1.BTH0._CRS.UBUF */
                }
            }
        }

        Device (URT2)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F0A" /* Intel Atom UART Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F0A" /* Intel Atom UART Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) HS-UART Controller #2 - 80860F0C")  // _DDN: DOS Device Name
            Name (_UID, 0x02)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y10)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000028,
                }
                FixedDMA (0x0004, 0x0004, Width32bit, )
                FixedDMA (0x0005, 0x0005, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.URT2._Y10._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.URT2._Y10._LEN, B0LN)  // _LEN: Length
                B0BA = U20A /* \U20A */
                B0LN = U20L /* \U20L */
                Return (RBUF) /* \_SB_.URT2.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((U20A == Zero) || (L14D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, U21A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }

            Device (GPS0)
            {
                Name (_HID, "LNV4752")  // _HID: Hardware ID
                Name (_HRV, 0x0F00)  // _HRV: Hardware Revision
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (UBUF, ResourceTemplate ()
                    {
                        UartSerialBus (0x0001C200, DataBitsEight, StopBitsOne,
                            0xFC, LittleEndian, ParityTypeNone, FlowControlHardware,
                            0x0020, 0x0020, "\\_SB.URT2",
                            0x00, ResourceConsumer, ,
                            )
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0001
                            }
                    })
                    Return (UBUF) /* \_SB_.URT2.GPS0._CRS.UBUF */
                }

                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }
            }
        }

        Device (SPI1)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F0E" /* Intel SPI Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F0E" /* Intel SPI Controller */)  // _CID: Compatible ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (_DDN, "Intel(R) SPI Controller - 80860F0E")  // _DDN: DOS Device Name
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y11)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000029,
                }
                FixedDMA (0x0000, 0x0000, Width32bit, )
                FixedDMA (0x0001, 0x0001, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.SPI1._Y11._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.SPI1._Y11._LEN, B0LN)  // _LEN: Length
                B0BA = SP0A /* \SP0A */
                B0LN = SP0L /* \SP0L */
                Return (RBUF) /* \_SB_.SPI1.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((SP0A == Zero) || (L15D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, SP1A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }

            Device (AUDI)
            {
                Name (_HID, "WM510205")  // _HID: Hardware ID
                Name (_CID, "WM510205")  // _CID: Compatible ID
                Name (_DDN, "Wolfson Microelectronics Audio WM5102")  // _DDN: DOS Device Name
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (SBUF, ResourceTemplate ()
                    {
                        SpiSerialBus (0x0001, PolarityLow, FourWireMode, 0x08,
                            ControllerInitiated, 0x007A1200, ClockPolarityLow,
                            ClockPhaseFirst, "\\_SB.SPI1",
                            0x00, ResourceConsumer, ,
                            )
                        GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone, 0x0000,
                            "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0004
                            }
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0003
                            }
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.GPO1", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0017
                            }
                    })
                    Return (SBUF) /* \_SB_.SPI1.AUDI._CRS.SBUF */
                }

                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
                {
                    CKC3 = Zero
                }

                Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
                {
                    CKC3 = One
                }

                Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                {
                }

                OperationRegion (GS06, SystemMemory, 0xFED0E240, 0x04)
                Field (GS06, DWordAcc, NoLock, WriteAsZeros)
                {
                    SUS6,   32
                }

                Method (CLKE, 0, NotSerialized)
                {
                    SUS6 = 0x2003CD01
                }

                Method (CLKD, 0, NotSerialized)
                {
                    SUS6 = 0x2003CD00
                }
            }
        }

        Device (I2C1)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _CID: Compatible ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (_DDN, "Intel(R) I2C Controller #1 - 80860F41")  // _DDN: DOS Device Name
            Name (_UID, One)  // _UID: Unique ID
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y12)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000020,
                }
                FixedDMA (0x0010, 0x0000, Width32bit, )
                FixedDMA (0x0011, 0x0001, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.I2C1._Y12._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.I2C1._Y12._LEN, B0LN)  // _LEN: Length
                B0BA = I10A /* \I10A */
                B0LN = I10L /* \I10L */
                Return (RBUF) /* \_SB_.I2C1.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((I10A == Zero) || (L21D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, I11A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }
        }

        Device (I2C2)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _CID: Compatible ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (_DDN, "Intel(R) I2C Controller #2 - 80860F42")  // _DDN: DOS Device Name
            Name (_UID, 0x02)  // _UID: Unique ID
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y13)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000021,
                }
                FixedDMA (0x0012, 0x0002, Width32bit, )
                FixedDMA (0x0013, 0x0003, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.I2C2._Y13._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.I2C2._Y13._LEN, B0LN)  // _LEN: Length
                B0BA = I20A /* \I20A */
                B0LN = I20L /* \I20L */
                Return (RBUF) /* \_SB_.I2C2.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((I20A == Zero) || (L22D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, I21A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }
        }

        Device (I2C3)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) I2C Controller #3 - 80860F43")  // _DDN: DOS Device Name
            Name (_UID, 0x03)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y14)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000022,
                }
                FixedDMA (0x0014, 0x0004, Width32bit, )
                FixedDMA (0x0015, 0x0005, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.I2C3._Y14._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.I2C3._Y14._LEN, B0LN)  // _LEN: Length
                B0BA = I30A /* \I30A */
                B0LN = I30L /* \I30L */
                Return (RBUF) /* \_SB_.I2C3.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((I30A == Zero) || (L23D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, I31A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }
        }

        Device (I2C4)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) I2C Controller #4 - 80860F44")  // _DDN: DOS Device Name
            Name (_UID, 0x04)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y15)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000023,
                }
                FixedDMA (0x0016, 0x0006, Width32bit, )
                FixedDMA (0x0017, 0x0007, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.I2C4._Y15._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.I2C4._Y15._LEN, B0LN)  // _LEN: Length
                B0BA = I40A /* \I40A */
                B0LN = I40L /* \I40L */
                Return (RBUF) /* \_SB_.I2C4.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((I40A == Zero) || (L24D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, I41A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }

            PowerResource (CLK0, 0x00, 0x0000)
            {
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (CKC0) /* \CKC0 */
                }

                Method (_ON, 0, NotSerialized)  // _ON_: Power On
                {
                    CKC0 = One
                    CKF0 = One
                    Sleep (0x20)
                }

                Method (_OFF, 0, NotSerialized)  // _OFF: Power Off
                {
                    CKC0 = 0x02
                }
            }

            PowerResource (CLK1, 0x00, 0x0000)
            {
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (CKC1) /* \CKC1 */
                }

                Method (_ON, 0, NotSerialized)  // _ON_: Power On
                {
                    CKC1 = One
                    CKF1 = One
                    Sleep (0x20)
                }

                Method (_OFF, 0, NotSerialized)  // _OFF: Power Off
                {
                    CKC1 = 0x02
                }
            }

            Device (CAM1)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "OVTI8865")  // _HID: Hardware ID
                Name (_CID, "OVTI8865")  // _CID: Compatible ID
                Name (_SUB, "17AA7003")  // _SUB: Subsystem ID
                Name (_DDN, "OV8865")  // _DDN: DOS Device Name
                Name (_UID, One)  // _UID: Unique ID
                Name (_DEP, Package (0x02)  // _DEP: Dependencies
                {
                    I2C7, 
                    ^^I2C7.PMIC
                })
                Name (_PR0, Package (0x03)  // _PR0: Power Resources for D0
                {
                    P28X, 
                    P18X, 
                    CLK0
                })
                Name (PLDB, Package (0x01)
                {
                    Buffer (0x14)
                    {
                        /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                        /* 0008 */  0x69, 0x0C, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,  /* i....... */
                        /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                    }
                })
                Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                {
                    Return (PLDB) /* \_SB_.I2C4.CAM1.PLDB */
                }

                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (SBUF, ResourceTemplate ()
                    {
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.GPO1", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0018
                            }
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.GPO1", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0015
                            }
                        I2cSerialBus (0x0036, ControllerInitiated, 0x00061A80,
                            AddressingMode7Bit, "\\_SB.I2C4",
                            0x00, ResourceConsumer, ,
                            )
                        I2cSerialBus (0x000C, ControllerInitiated, 0x00061A80,
                            AddressingMode7Bit, "\\_SB.I2C4",
                            0x00, ResourceConsumer, ,
                            )
                    })
                    Return (SBUF) /* \_SB_.I2C4.CAM1._CRS.SBUF */
                }

                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If ((Arg0 == ToUUID ("377ba76a-f390-4aff-ab38-9b1bf33a3015")))
                    {
                        Return ("OVTI8865")
                    }

                    If ((Arg0 == ToUUID ("3c62aaaa-d8e0-401a-84c3-fc05656fa28c")))
                    {
                        Return ("OV8865")
                    }

                    If ((Arg0 == ToUUID ("822ace8f-2814-4174-a56b-5f029fe079ee")))
                    {
                        Return ("P8V10D")
                    }

                    If ((Arg0 == ToUUID ("2959512a-028c-4646-b73d-4d1b5672fad8")))
                    {
                        Return ("BLADEII")
                    }

                    If ((Arg0 == ToUUID ("918ab242-c37c-450a-9d0f-f47ab97c3dea")))
                    {
                        Return (0x0104)
                    }

                    If ((Arg0 == ToUUID ("ea3b7bd8-e09b-4239-ad6e-ed525f3f26ab")))
                    {
                        Return (One)
                    }

                    If ((Arg0 == ToUUID ("b65ac492-9e30-4d60-b5b2-f497c790d9cf")))
                    {
                        Return (Zero)
                    }

                    If ((Arg0 == ToUUID ("e770ab0f-2644-4bab-8628-d62f1683fb9d")))
                    {
                        Return (One)
                    }

                    If ((Arg0 == ToUUID ("1ea54ab2-cd84-48cc-9dd4-7f594ec3b015")))
                    {
                        Return (Zero)
                    }

                    If ((Arg0 == ToUUID ("8dbe2651-70c1-4c6f-ac87-a37cb46e4af6")))
                    {
                        Return (Zero)
                    }

                    If ((Arg0 == ToUUID ("75c9a639-5c8a-4a00-9f48-a9c3b5da789f")))
                    {
                        Return ("BU64243")
                    }

                    If ((Arg0 == ToUUID ("26257549-9271-4ca4-bb43-c4899d5a4881")))
                    {
                        If ((Arg2 == One))
                        {
                            Return (0x02)
                        }

                        If ((Arg2 == 0x02))
                        {
                            Return (0x04003600)
                        }

                        If ((Arg2 == 0x03))
                        {
                            Return (0x04000C01)
                        }
                    }

                    If ((Arg0 == ToUUID ("79234640-9e10-4fea-a5c1-b5aa8b19756f")))
                    {
                        If ((Arg2 == One))
                        {
                            Return (0x02)
                        }

                        If ((Arg2 == 0x02))
                        {
                            Return (0x01001800)
                        }

                        If ((Arg2 == 0x03))
                        {
                            Return (0x01001501)
                        }
                    }

                    Return (Zero)
                }
            }

            Device (CAM2)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "OVTI9760")  // _HID: Hardware ID
                Name (_CID, "OVTI9760")  // _CID: Compatible ID
                Name (_SUB, "17AA7003")  // _SUB: Subsystem ID
                Name (_DDN, "OV9760")  // _DDN: DOS Device Name
                Name (_UID, One)  // _UID: Unique ID
                Name (_DEP, Package (0x02)  // _DEP: Dependencies
                {
                    I2C7, 
                    ^^I2C7.PMIC
                })
                Name (_PR0, Package (0x03)  // _PR0: Power Resources for D0
                {
                    P28X, 
                    P18X, 
                    CLK1
                })
                Name (PLDB, Package (0x01)
                {
                    Buffer (0x14)
                    {
                        /* 0000 */  0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /* ........ */
                        /* 0008 */  0x61, 0x0C, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,  /* a....... */
                        /* 0010 */  0xFF, 0xFF, 0xFF, 0xFF                           /* .... */
                    }
                })
                Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                {
                    Return (PLDB) /* \_SB_.I2C4.CAM2.PLDB */
                }

                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (SBUF, ResourceTemplate ()
                    {
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.GPO1", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0019
                            }
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.GPO1", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0016
                            }
                        I2cSerialBus (0x0010, ControllerInitiated, 0x00061A80,
                            AddressingMode7Bit, "\\_SB.I2C4",
                            0x00, ResourceConsumer, ,
                            )
                    })
                    Return (SBUF) /* \_SB_.I2C4.CAM2._CRS.SBUF */
                }

                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If ((Arg0 == ToUUID ("377ba76a-f390-4aff-ab38-9b1bf33a3015")))
                    {
                        Return ("OVTI9760")
                    }

                    If ((Arg0 == ToUUID ("3c62aaaa-d8e0-401a-84c3-fc05656fa28c")))
                    {
                        Return ("OV9760")
                    }

                    If ((Arg0 == ToUUID ("822ace8f-2814-4174-a56b-5f029fe079ee")))
                    {
                        Return ("L9760F30")
                    }

                    If ((Arg0 == ToUUID ("2959512a-028c-4646-b73d-4d1b5672fad8")))
                    {
                        Return ("BLADEII")
                    }

                    If ((Arg0 == ToUUID ("918ab242-c37c-450a-9d0f-f47ab97c3dea")))
                    {
                        Return (0x0101)
                    }

                    If ((Arg0 == ToUUID ("ea3b7bd8-e09b-4239-ad6e-ed525f3f26ab")))
                    {
                        Return (Zero)
                    }

                    If ((Arg0 == ToUUID ("b65ac492-9e30-4d60-b5b2-f497c790d9cf")))
                    {
                        Return (Zero)
                    }

                    If ((Arg0 == ToUUID ("e770ab0f-2644-4bab-8628-d62f1683fb9d")))
                    {
                        Return (One)
                    }

                    If ((Arg0 == ToUUID ("1ea54ab2-cd84-48cc-9dd4-7f594ec3b015")))
                    {
                        Return (Zero)
                    }

                    If ((Arg0 == ToUUID ("8dbe2651-70c1-4c6f-ac87-a37cb46e4af6")))
                    {
                        Return (Zero)
                    }

                    If ((Arg0 == ToUUID ("75c9a639-5c8a-4a00-9f48-a9c3b5da789f")))
                    {
                        Return (Zero)
                    }

                    If ((Arg0 == ToUUID ("26257549-9271-4ca4-bb43-c4899d5a4881")))
                    {
                        If ((Arg2 == One))
                        {
                            Return (One)
                        }

                        If ((Arg2 == 0x02))
                        {
                            Return (0x04001000)
                        }
                    }

                    If ((Arg0 == ToUUID ("79234640-9e10-4fea-a5c1-b5aa8b19756f")))
                    {
                        If ((Arg2 == One))
                        {
                            Return (0x02)
                        }

                        If ((Arg2 == 0x02))
                        {
                            Return (0x01001900)
                        }

                        If ((Arg2 == 0x03))
                        {
                            Return (0x01001601)
                        }
                    }

                    Return (Zero)
                }
            }
        }

        OperationRegion (XMOS, SystemIO, 0x72, 0x02)
        Field (XMOS, ByteAcc, Lock, Preserve)
        {
            IMOS,   8, 
            DMOS,   8
        }

        Method (RDMS, 1, NotSerialized)
        {
            Local0 = Zero
            IMOS = Arg0
            Local0 = DMOS /* \_SB_.DMOS */
            Return (Local0)
        }

        Device (I2C5)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) I2C Controller #5 - 80860F45")  // _DDN: DOS Device Name
            Name (_UID, 0x05)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y16)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000024,
                }
                FixedDMA (0x0018, 0x0000, Width32bit, )
                FixedDMA (0x0019, 0x0001, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.I2C5._Y16._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.I2C5._Y16._LEN, B0LN)  // _LEN: Length
                B0BA = I50A /* \I50A */
                B0LN = I50L /* \I50L */
                Return (RBUF) /* \_SB_.I2C5.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((I50A == Zero) || (L25D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, I51A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }

            Device (HALL)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "MXM1120")  // _HID: Hardware ID
                Name (_UID, One)  // _UID: Unique ID
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (RBUF, ResourceTemplate ()
                    {
                        I2cSerialBus (0x000C, ControllerInitiated, 0x00061A80,
                            AddressingMode7Bit, "\\_SB.I2C5",
                            0x00, ResourceConsumer, ,
                            )
                        GpioInt (Edge, ActiveLow, Exclusive, PullNone, 0x0000,
                            "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0019
                            }
                    })
                    Return (RBUF) /* \_SB_.I2C5.HALL._CRS.RBUF */
                }

                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }
            }

            Device (SPBA)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "ACCL0001")  // _HID: Hardware ID
                Name (_CID, "INTACEL")  // _CID: Compatible ID
                Name (_UID, One)  // _UID: Unique ID
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (RBUF, ResourceTemplate ()
                    {
                        I2cSerialBus (0x001D, ControllerInitiated, 0x00061A80,
                            AddressingMode7Bit, "\\_SB.I2C5",
                            0x00, ResourceConsumer, ,
                            )
                    })
                    Return (RBUF) /* \_SB_.I2C5.SPBA._CRS.RBUF */
                }

                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If ((Arg0 == ToUUID ("5aa98d50-aa43-4e83-bc87-104dab4c95b6")))
                    {
                        Return ("LSM303DA")
                    }

                    Return (Zero)
                }
            }

            Device (SPBM)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "MAGN0001")  // _HID: Hardware ID
                Name (_CID, "INTMAGN")  // _CID: Compatible ID
                Name (_UID, One)  // _UID: Unique ID
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (RBUF, ResourceTemplate ()
                    {
                        I2cSerialBus (0x001D, ControllerInitiated, 0x00061A80,
                            AddressingMode7Bit, "\\_SB.I2C5",
                            0x00, ResourceConsumer, ,
                            )
                    })
                    Return (RBUF) /* \_SB_.I2C5.SPBM._CRS.RBUF */
                }

                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If ((Arg0 == ToUUID ("76a2ac83-4fa2-4532-957e-f6d12d0ea1ac")))
                    {
                        Return ("LSM303DM")
                    }

                    Return (Zero)
                }
            }

            Device (SALS)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "CALS0001")  // _HID: Hardware ID
                Name (_CID, "INTLALS")  // _CID: Compatible ID
                Name (_UID, One)  // _UID: Unique ID
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (RBUF, ResourceTemplate ()
                    {
                        I2cSerialBus (0x001C, ControllerInitiated, 0x00061A80,
                            AddressingMode7Bit, "\\_SB.I2C5",
                            0x00, ResourceConsumer, ,
                            )
                    })
                    Return (RBUF) /* \_SB_.I2C5.SALS._CRS.RBUF */
                }

                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If ((Arg0 == ToUUID ("2dfcfbfa-e7f2-402d-a065-3ec6dfff980d")))
                    {
                        Return ("AL3320B")
                    }

                    Return (Zero)
                }
            }

            Device (SRCL)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "SRCL0001")  // _HID: Hardware ID
                Name (_CID, "INTSRCL")  // _CID: Compatible ID
                Name (_UID, One)  // _UID: Unique ID
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If ((Arg0 == ToUUID ("c4601e6b-4043-426a-894b-c8746b5ebff5")))
                    {
                        If ((Arg1 == Zero))
                        {
                            ADBG ("SENSOR INPUT")
                            Return ("OXOOXXXX")
                        }

                        If ((Arg1 == One))
                        {
                            ADBG ("SENSOR OUTPUT")
                            Return ("OOOOOOXXXX")
                        }
                    }

                    Return (Zero)
                }
            }
        }

        Device (I2C6)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) I2C Controller #6 - 80860F46")  // _DDN: DOS Device Name
            Name (_UID, 0x06)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y17)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000025,
                }
                FixedDMA (0x001A, 0x0002, Width32bit, )
                FixedDMA (0x001B, 0x0003, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.I2C6._Y17._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.I2C6._Y17._LEN, B0LN)  // _LEN: Length
                B0BA = I60A /* \I60A */
                B0LN = I60L /* \I60L */
                Return (RBUF) /* \_SB_.I2C6.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((I60A == Zero) || (L26D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, I61A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }

            PowerResource (TCPR, 0x00, 0x0000)
            {
                Name (_DEP, Package (0x02)  // _DEP: Dependencies
                {
                    I2C7, 
                    ^^I2C7.PMIC
                })
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If ((^^^I2C7.PMIC.AVBL == One))
                    {
                        Return (^^^I2C7.PMIC.TCON) /* \_SB_.I2C7.PMIC.TCON */
                    }

                    Return (Zero)
                }

                Method (_ON, 0, NotSerialized)  // _ON_: Power On
                {
                    If ((^^^GPO0.AVBL == One))
                    {
                        ^^^GPO0.TCD3 = Zero
                    }

                    Sleep (0x05)
                    If ((^^^I2C7.PMIC.AVBG == One))
                    {
                        ^^^I2C7.PMIC.TCON = One
                    }

                    Sleep (0x0A)
                    If ((^^^GPO0.AVBL == One))
                    {
                        ^^^GPO0.TCD3 = One
                    }

                    Sleep (0x50)
                }

                Method (_OFF, 0, NotSerialized)  // _OFF: Power Off
                {
                    If ((^^^I2C7.PMIC.AVBG == One))
                    {
                        ^^^I2C7.PMIC.TCON = Zero
                    }
                }
            }

            Device (TCS0)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "SYNA0001")  // _HID: Hardware ID
                Name (_CID, "PNP0C50" /* HID Protocol Device (I2C bus) */)  // _CID: Compatible ID
                Name (_S0W, Zero)  // _S0W: S0 Device Wake State
                Name (_DEP, Package (0x02)  // _DEP: Dependencies
                {
                    GPO0, 
                    I2C7
                })
                OperationRegion (GC06, SystemMemory, 0xFED0C620, 0x04)
                Field (GC06, DWordAcc, NoLock, WriteAsZeros)
                {
                    HBTN,   32
                }

                Method (_PS3, 0, Serialized)  // _PS3: Power State 3
                {
                    HBTN = 0x2003CC80
                }

                Method (_PS0, 0, Serialized)  // _PS0: Power State 0
                {
                    HBTN = 0x2503CC80
                    If ((^^^GPO0.AVBL == One))
                    {
                        ^^^GPO0.TCD3 = Zero
                    }

                    Sleep (0x05)
                    If ((^^^I2C7.PMIC.AVBG == One))
                    {
                        ^^^I2C7.PMIC.TCON = One
                    }

                    Sleep (0x1E)
                    If ((^^^GPO0.AVBL == One))
                    {
                        ^^^GPO0.TCD3 = One
                    }

                    Sleep (0x78)
                }

                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (RBUF, ResourceTemplate ()
                    {
                        I2cSerialBus (0x002C, ControllerInitiated, 0x00061A80,
                            AddressingMode7Bit, "\\_SB.I2C6",
                            0x00, ResourceConsumer, ,
                            )
                        Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
                        {
                            0x00000045,
                        }
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x003C
                            }
                    })
                    Return (RBUF) /* \_SB_.I2C6.TCS0._CRS.RBUF */
                }

                Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                {
                    Name (_T_1, Zero)  // _T_x: Emitted by ASL Compiler
                    Name (_T_0, Zero)  // _T_x: Emitted by ASL Compiler
                    Debug = "Method _DSM begin"
                    If ((Arg0 == ToUUID ("3cdff6f7-4267-4555-ad05-b30a3d8938de") /* HID I2C Device */))
                    {
                        While (One)
                        {
                            _T_0 = ToInteger (Arg2)
                            If ((_T_0 == Zero))
                            {
                                While (One)
                                {
                                    _T_1 = ToInteger (Arg1)
                                    If ((_T_1 == One))
                                    {
                                        Debug = "Method _DSM Function Query"
                                        Return (Buffer (One)
                                        {
                                             0x03                                             /* . */
                                        })
                                    }
                                    Else
                                    {
                                        Return (Buffer (One)
                                        {
                                             0x00                                             /* . */
                                        })
                                    }

                                    Break
                                }
                            }
                            Else
                            {
                                If ((_T_0 == One))
                                {
                                    Debug = "Method _DSM Function HID"
                                    Return (0x20)
                                }
                                Else
                                {
                                    Return (Zero)
                                }
                            }

                            Break
                        }
                    }
                    Else
                    {
                        Return (Buffer (One)
                        {
                             0x00                                             /* . */
                        })
                    }
                }

                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }
            }
        }

        Device (HISP)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "HISP0011")  // _HID: Hardware ID
            Name (_CID, "HISP0011")  // _CID: Compatible ID
            Name (_DDN, "HISP (GPIO) controller")  // _DDN: DOS Device Name
            Name (_UID, One)  // _UID: Unique ID
            Name (_DEP, Package (0x03)  // _DEP: Dependencies
            {
                I2C6, 
                GPO0, 
                GPO2
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (RBUF, ResourceTemplate ()
                {
                    I2cSerialBus (0x002C, ControllerInitiated, 0x00061A80,
                        AddressingMode7Bit, "\\_SB.I2C6",
                        0x00, ResourceConsumer, ,
                        )
                    GpioIo (Shared, PullUp, 0x0000, 0x0000, IoRestrictionNone,
                        "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                        RawDataBuffer (0x01)  // Vendor Data
                        {
                            0x01
                        })
                        {   // Pin list
                            0x0059
                        }
                    GpioIo (Shared, PullUp, 0x0000, 0x0000, IoRestrictionNone,
                        "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                        RawDataBuffer (0x01)  // Vendor Data
                        {
                            0x01
                        })
                        {   // Pin list
                            0x000C
                        }
                })
                Return (RBUF) /* \_SB_.HISP._CRS.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Local0 = RDMS (One)
                Local1 = RDMS (0x02)
                If ((Local0 == Local1))
                {
                    If ((Local0 == One))
                    {
                        Return (0x0F)
                    }
                }

                Return (Zero)
            }
        }

        Device (I2C7)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _HID: Hardware ID
            Name (_CID, "80860F41" /* Intel Baytrail I2C Host Controller */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) I2C Controller #7 - 80860F47")  // _DDN: DOS Device Name
            Name (_UID, 0x07)  // _UID: Unique ID
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                PEPD
            })
            Name (RBUF, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y18)
                Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                {
                    0x00000026,
                }
                FixedDMA (0x001C, 0x0004, Width32bit, )
                FixedDMA (0x001D, 0x0005, Width32bit, )
            })
            Method (_HRV, 0, NotSerialized)  // _HRV: Hardware Revision
            {
                Return (SOCS) /* \SOCS */
            }

            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (RBUF, \_SB.I2C7._Y18._BAS, B0BA)  // _BAS: Base Address
                CreateDWordField (RBUF, \_SB.I2C7._Y18._LEN, B0LN)  // _LEN: Length
                B0BA = I70A /* \I70A */
                B0LN = I70L /* \I70L */
                Return (RBUF) /* \_SB_.I2C7.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((I70A == Zero) || (L27D == One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                PSAT |= 0x03
                PSAT |= Zero
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                PSAT &= 0xFFFFFFFC
                PSAT |= Zero
            }

            OperationRegion (KEYS, SystemMemory, I71A, 0x0100)
            Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
            {
                Offset (0x84), 
                PSAT,   32
            }
        }

        Device (LID0)
        {
            Name (_HID, EisaId ("PNP0C0D") /* Lid Device */)  // _HID: Hardware ID
            Method (_LID, 0, NotSerialized)  // _LID: Lid Status
            {
                If ((^^GPO2.AVBL == One))
                {
                    Local0 = ^^GPO2.HINT /* \_SB_.GPO2.HINT */
                    If ((Local0 & One))
                    {
                        Return (One)
                    }
                    Else
                    {
                        Return (Zero)
                    }
                }

                Return (One)
            }
        }

        Scope (I2C7)
        {
            Device (PMIC)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "INT33FD" /* Intel Baytrail Power Management IC */)  // _HID: Hardware ID
                Name (_CID, "INT33FD" /* Intel Baytrail Power Management IC */)  // _CID: Compatible ID
                Name (_DDN, "PMIC GPIO Controller")  // _DDN: DOS Device Name
                Name (_HRV, 0x02)  // _HRV: Hardware Revision
                Name (_UID, One)  // _UID: Unique ID
                Name (_DEP, Package (0x01)  // _DEP: Dependencies
                {
                    I2C7
                })
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (SBUF, ResourceTemplate ()
                    {
                        I2cSerialBus (0x006E, ControllerInitiated, 0x000F4240,
                            AddressingMode7Bit, "\\_SB.I2C7",
                            0x00, ResourceConsumer, ,
                            )
                        Interrupt (ResourceConsumer, Level, ActiveHigh, Shared, ,, )
                        {
                            0x00000043,
                        }
                        Interrupt (ResourceConsumer, Level, ActiveHigh, Shared, ,, )
                        {
                            0x00000043,
                        }
                        Interrupt (ResourceConsumer, Level, ActiveHigh, Shared, ,, )
                        {
                            0x00000043,
                        }
                    })
                    Return (SBUF) /* \_SB_.I2C7.PMIC._CRS.SBUF */
                }

                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If ((PMEN == Zero))
                    {
                        Return (Zero)
                    }

                    Return (0x0F)
                }

                OperationRegion (DPTF, 0x8C, Zero, 0x0100)
                Field (DPTF, DWordAcc, NoLock, Preserve)
                {
                    TMP0,   32, 
                    AX00,   32, 
                    AX01,   32, 
                    TMP1,   32, 
                    AX10,   32, 
                    AX11,   32, 
                    TMP2,   32, 
                    AX20,   32, 
                    AX21,   32, 
                    TMP3,   32, 
                    AX30,   32, 
                    AX31,   32, 
                    TMP4,   32, 
                    AX40,   32, 
                    AX41,   32, 
                    TMP5,   32, 
                    AX50,   32, 
                    AX51,   32, 
                    PEN0,   32, 
                    PEN1,   32, 
                    PEN2,   32, 
                    PEN3,   32, 
                    PEN4,   32, 
                    PEN5,   32
                }

                OperationRegion (PMOP, 0x8D, Zero, 0x0100)
                Field (PMOP, DWordAcc, NoLock, Preserve)
                {
                    VSYS,   32, 
                    SYSX,   32, 
                    SYSU,   32, 
                    SYSS,   32, 
                    V50S,   32, 
                    HOST,   32, 
                    VBUS,   32, 
                    HDMI,   32, 
                    S285,   32, 
                    X285,   32, 
                    V33A,   32, 
                    V33S,   32, 
                    V33U,   32, 
                    V33I,   32, 
                    V18A,   32, 
                    REFQ,   32, 
                    V12A,   32, 
                    V18S,   32, 
                    V18X,   32, 
                    V18U,   32, 
                    V12X,   32, 
                    V12S,   32, 
                    V10A,   32, 
                    V10S,   32, 
                    V10X,   32, 
                    V105,   32
                }

                OperationRegion (GPOP, GeneralPurposeIo, Zero, 0x0100)
                Field (GPOP, ByteAcc, NoLock, Preserve)
                {
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0020
                            }
                    ), 
                    GMP0,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0021
                            }
                    ), 
                    GX00,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0022
                            }
                    ), 
                    GX01,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0023
                            }
                    ), 
                    GMP1,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0024
                            }
                    ), 
                    GX10,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0025
                            }
                    ), 
                    GX11,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0026
                            }
                    ), 
                    GMP2,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0027
                            }
                    ), 
                    GX20,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0028
                            }
                    ), 
                    GX21,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0029
                            }
                    ), 
                    GMP3,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x002A
                            }
                    ), 
                    GX30,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x002B
                            }
                    ), 
                    GX31,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x002C
                            }
                    ), 
                    GMP4,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x002D
                            }
                    ), 
                    GX40,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x002E
                            }
                    ), 
                    GX41,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x002F
                            }
                    ), 
                    GMP5,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0030
                            }
                    ), 
                    GX50,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0031
                            }
                    ), 
                    GX51,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0032
                            }
                    ), 
                    GEN0,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0033
                            }
                    ), 
                    GEN1,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0034
                            }
                    ), 
                    GEN2,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0035
                            }
                    ), 
                    GEN3,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0036
                            }
                    ), 
                    GEN4,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0037
                            }
                    ), 
                    GEN5,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0040
                            }
                    ), 
                    GSYS,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0041
                            }
                    ), 
                    GYSX,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0042
                            }
                    ), 
                    GYSU,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0043
                            }
                    ), 
                    GYSS,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0044
                            }
                    ), 
                    G50S,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0045
                            }
                    ), 
                    GOST,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0046
                            }
                    ), 
                    GBUS,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0047
                            }
                    ), 
                    GDMI,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0048
                            }
                    ), 
                    G28S,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0049
                            }
                    ), 
                    G28X,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x004A
                            }
                    ), 
                    G33A,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x004B
                            }
                    ), 
                    G33S,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x004C
                            }
                    ), 
                    G33U,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x004D
                            }
                    ), 
                    G33I,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x004E
                            }
                    ), 
                    G18A,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x004F
                            }
                    ), 
                    GEFQ,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0050
                            }
                    ), 
                    G12A,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0051
                            }
                    ), 
                    G18S,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0052
                            }
                    ), 
                    G18X,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0053
                            }
                    ), 
                    G18U,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0054
                            }
                    ), 
                    G12X,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0055
                            }
                    ), 
                    G12S,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0056
                            }
                    ), 
                    G10A,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0057
                            }
                    ), 
                    G10S,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0058
                            }
                    ), 
                    G10X,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0059
                            }
                    ), 
                    G105,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x005E
                            }
                    ), 
                    FCOT,   1, 
                    Connection (
                        GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.I2C7.PMIC", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x000B
                            }
                    ), 
                    TCON,   1
                }

                Name (AVBL, Zero)
                Name (AVBD, Zero)
                Name (AVBG, Zero)
                Method (_REG, 2, NotSerialized)  // _REG: Region Availability
                {
                    If ((Arg0 == 0x08))
                    {
                        AVBG = Arg1
                    }

                    If ((Arg0 == 0x8D))
                    {
                        AVBL = Arg1
                    }

                    If ((Arg0 == 0x8C))
                    {
                        AVBD = Arg1
                    }
                }

                Name (LPAT, Package (0x30)
                {
                    0x09E3, 
                    0x03D1, 
                    0x0A15, 
                    0x03C1, 
                    0x0A47, 
                    0x03AD, 
                    0x0A79, 
                    0x0395, 
                    0x0AAB, 
                    0x0377, 
                    0x0ADD, 
                    0x0355, 
                    0x0B0F, 
                    0x032D, 
                    0x0B41, 
                    0x0301, 
                    0x0B73, 
                    0x02D0, 
                    0x0BA5, 
                    0x029D, 
                    0x0BD7, 
                    0x0267, 
                    0x0C09, 
                    0x0231, 
                    0x0C3B, 
                    0x01FC, 
                    0x0C6D, 
                    0x01C8, 
                    0x0C9F, 
                    0x0197, 
                    0x0CD1, 
                    0x0165, 
                    0x0D03, 
                    0x013B, 
                    0x0D35, 
                    0x0115, 
                    0x0D67, 
                    0xF3, 
                    0x0D99, 
                    0xD4, 
                    0x0DCB, 
                    0xBA, 
                    0x0DFD, 
                    0xA2, 
                    0x0E2F, 
                    0x8C, 
                    0x0E93, 
                    0x6B
                })
            }
        }

        Scope (I2C1)
        {
            Device (IMP1)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "IMPJ0001")  // _HID: Hardware ID
                Name (_CID, "IMPJ0001")  // _CID: Compatible ID
                Name (_UID, One)  // _UID: Unique ID
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If ((PSSD == One))
                    {
                        Return (0x0F)
                    }

                    Return (Zero)
                }

                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (SBUF, ResourceTemplate ()
                    {
                        I2cSerialBus (0x006E, ControllerInitiated, 0x000186A0,
                            AddressingMode7Bit, "\\_SB.I2C1",
                            0x00, ResourceConsumer, ,
                            )
                    })
                    Return (SBUF) /* \_SB_.I2C1.IMP1._CRS.SBUF */
                }
            }

            Device (IMP2)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "IMPJ0002")  // _HID: Hardware ID
                Name (_CID, "IMPJ0002")  // _CID: Compatible ID
                Name (_UID, One)  // _UID: Unique ID
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If ((PSSD == One))
                    {
                        Return (0x0F)
                    }

                    Return (Zero)
                }

                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (SBUF, ResourceTemplate ()
                    {
                        I2cSerialBus (0x006F, ControllerInitiated, 0x000186A0,
                            AddressingMode7Bit, "\\_SB.I2C1",
                            0x00, ResourceConsumer, ,
                            )
                    })
                    Return (SBUF) /* \_SB_.I2C1.IMP2._CRS.SBUF */
                }
            }

            Device (IMP3)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "IMPJ0003")  // _HID: Hardware ID
                Name (_CID, "IMPJ0003")  // _CID: Compatible ID
                Name (_UID, One)  // _UID: Unique ID
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If ((PSSD == 0x02))
                    {
                        Return (0x0F)
                    }

                    Return (Zero)
                }

                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Name (SBUF, ResourceTemplate ()
                    {
                        I2cSerialBus (0x006E, ControllerInitiated, 0x000186A0,
                            AddressingMode7Bit, "\\_SB.I2C1",
                            0x00, ResourceConsumer, ,
                            )
                    })
                    Return (SBUF) /* \_SB_.I2C1.IMP3._CRS.SBUF */
                }
            }
        }

        PowerResource (P28X, 0x05, 0x0000)
        {
            Name (_DEP, Package (0x02)  // _DEP: Dependencies
            {
                I2C7, 
                ^I2C7.PMIC
            })
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((^^I2C7.PMIC.AVBG == One))
                {
                    ^^I2C7.PMIC.G28X = Zero
                    If ((^^I2C7.PMIC.AVBL == One))
                    {
                        Return (^^I2C7.PMIC.X285) /* \_SB_.I2C7.PMIC.X285 */
                    }
                }

                Return (Zero)
            }

            Method (_ON, 0, NotSerialized)  // _ON_: Power On
            {
                If ((^^I2C7.PMIC.AVBL == One))
                {
                    ^^I2C7.PMIC.X285 = One
                    If ((^^I2C7.PMIC.AVBG == One))
                    {
                        ^^I2C7.PMIC.G28X = One
                        Sleep (0x1E)
                    }
                }
            }

            Method (_OFF, 0, NotSerialized)  // _OFF: Power Off
            {
                If ((^^I2C7.PMIC.AVBL == One))
                {
                    ^^I2C7.PMIC.X285 = Zero
                    If ((^^I2C7.PMIC.AVBG == One))
                    {
                        ^^I2C7.PMIC.G28X = One
                        Sleep (0x1E)
                    }
                }
            }
        }

        PowerResource (P18X, 0x05, 0x0000)
        {
            Name (_DEP, Package (0x02)  // _DEP: Dependencies
            {
                I2C7, 
                ^I2C7.PMIC
            })
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((^^I2C7.PMIC.AVBG == One))
                {
                    ^^I2C7.PMIC.G18X = Zero
                    If ((^^I2C7.PMIC.AVBL == One))
                    {
                        Return (^^I2C7.PMIC.V18X) /* \_SB_.I2C7.PMIC.V18X */
                    }
                }

                Return (Zero)
            }

            Method (_ON, 0, NotSerialized)  // _ON_: Power On
            {
                If ((^^I2C7.PMIC.AVBL == One))
                {
                    ^^I2C7.PMIC.V18X = One
                    If ((^^I2C7.PMIC.AVBG == One))
                    {
                        ^^I2C7.PMIC.G18X = One
                        Sleep (0x1E)
                    }
                }
            }

            Method (_OFF, 0, NotSerialized)  // _OFF: Power Off
            {
                If ((^^I2C7.PMIC.AVBL == One))
                {
                    ^^I2C7.PMIC.V18X = Zero
                    If ((^^I2C7.PMIC.AVBG == One))
                    {
                        ^^I2C7.PMIC.G18X = One
                        Sleep (0x1E)
                    }
                }
            }
        }

        Device (TBAD)
        {
            Name (_HID, "INTCFD9" /* Intel Baytrail SOC GPIO Controller */)  // _HID: Hardware ID
            Name (_CID, "PNP0C40" /* Standard Button Controller */)  // _CID: Compatible ID
            Name (_DDN, "Keyboard less system - 5 Button Array Device")  // _DDN: DOS Device Name
            Name (_DEP, Package (0x04)  // _DEP: Dependencies
            {
                GPO0, 
                GPO2, 
                I2C7, 
                ^I2C7.PMIC
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (PBUF, ResourceTemplate ()
                {
                    GpioInt (Edge, ActiveBoth, ExclusiveAndWake, PullDefault, 0x0000,
                        "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0010
                        }
                    GpioInt (Edge, ActiveBoth, ExclusiveAndWake, PullDefault, 0x0000,
                        "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0006
                        }
                    GpioInt (Edge, ActiveBoth, Exclusive, PullDefault, 0x0000,
                        "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0005
                        }
                    GpioInt (Edge, ActiveBoth, Exclusive, PullDefault, 0x0000,
                        "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0004
                        }
                })
                Return (PBUF) /* \_SB_.TBAD._CRS.PBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
            {
                Name (_T_0, Zero)  // _T_x: Emitted by ASL Compiler
                If ((OSYS == 0x07DD))
                {
                    ^^I2C7.PMIC.FCOT = One
                }
                Else
                {
                    ^^I2C7.PMIC.FCOT = Zero
                }

                If ((Arg0 == ToUUID ("dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c") /* Power Button Device */))
                {
                    While (One)
                    {
                        _T_0 = ToInteger (Arg2)
                        If ((_T_0 == Zero))
                        {
                            Return (Buffer (One)
                            {
                                 0x03                                             /* . */
                            })
                        }
                        Else
                        {
                            If ((_T_0 == One))
                            {
                                Return (0x07)
                            }
                        }

                        Break
                    }
                }
                Else
                {
                    Return (Buffer (One)
                    {
                         0x00                                             /* . */
                    })
                }

                Return (Zero)
            }
        }

        Device (MBID)
        {
            Name (_HID, "INT33BD" /* Intel Baytrail Mailbox Device */)  // _HID: Hardware ID
            Name (_CID, "INT33BD" /* Intel Baytrail Mailbox Device */)  // _CID: Compatible ID
            Name (_HRV, 0x02)  // _HRV: Hardware Revision
            Name (_UID, One)  // _UID: Unique ID
            Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
            {
                Name (RBUF, ResourceTemplate ()
                {
                    Memory32Fixed (ReadWrite,
                        0xE00000D0,         // Address Base
                        0x0000000C,         // Address Length
                        )
                })
                Return (RBUF) /* \_SB_.MBID._CRS.RBUF */
            }

            OperationRegion (REGS, 0x87, Zero, 0x30)
            Field (REGS, DWordAcc, NoLock, Preserve)
            {
                PORT,   32, 
                REG,    32, 
                DATA,   32, 
                MASK,   32, 
                BE,     32, 
                OP,     32
            }

            Name (AVBL, Zero)
            Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If ((Arg0 == 0x87))
                {
                    AVBL = Arg1
                }
            }

            Method (READ, 3, Serialized)
            {
                Local0 = 0xFFFFFFFF
                If ((AVBL == One))
                {
                    OP = Zero
                    PORT = Arg0
                    REG = Arg1
                    BE = Arg2
                    Local0 = DATA /* \_SB_.MBID.DATA */
                }

                Return (Local0)
            }

            Method (WRIT, 4, Serialized)
            {
                If ((AVBL == One))
                {
                    OP = One
                    PORT = Arg0
                    REG = Arg1
                    BE = Arg2
                    DATA = Arg3
                }
            }

            Method (MODI, 5, Serialized)
            {
                If ((AVBL == One))
                {
                    OP = 0x02
                    PORT = Arg0
                    REG = Arg1
                    BE = Arg2
                    DATA = Arg3
                    MASK = Arg4
                }
            }
        }

        Device (PAGD)
        {
            Name (_HID, "ACPI000C" /* Processor Aggregator Device */)  // _HID: Hardware ID
            Name (_CID, "ACPI000C" /* Processor Aggregator Device */)  // _CID: Compatible ID
            Name (IDCN, Zero)
            Name (PURP, Package (0x02)
            {
                One, 
                Zero
            })
            Method (_PUR, 0, Serialized)  // _PUR: Processor Utilization Request
            {
                Index (PURP, One) = IDCN /* \_SB_.PAGD.IDCN */
                Return (PURP) /* \_SB_.PAGD.PURP */
            }

            Method (_OST, 3, Serialized)  // _OST: OSPM Status Indication
            {
                Debug = "_OST is invoked"
            }
        }
    }

    Name (PICM, Zero)
    Device (MDM)
    {
        Name (_HID, EisaId ("MCD0001"))  // _HID: Hardware ID
        Name (_CID, "MCD0001")  // _CID: Compatible ID
        Name (CPU, "ValleyView2")
        Name (MDMN, "XMM_7160")
        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            Return (Zero)
        }

        Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
        {
            Name (UBUF, ResourceTemplate ()
            {
                GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                    "\\_SB.GPO1", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x001A
                    }
                GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionInputOnly,
                    "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x001E
                    }
                GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionInputOnly,
                    "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x001C
                    }
                GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                    "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x001D
                    }
                GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                    "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x003A
                    }
            })
            Return (UBUF) /* \MDM_._CRS.UBUF */
        }

        Name (PMIC, Package (0x04)
        {
            0x29, 
            One, 
            Zero, 
            0xFC
        })
        Name (EPWR, Package (0x02)
        {
            Zero, 
            One
        })
    }

    Scope (_TZ)
    {
        ThermalZone (TZ00)
        {
            Name (_DEP, Package (0x02)  // _DEP: Dependencies
            {
                \_SB.I2C7, 
                \_SB.I2C7.PMIC
            })
            Method (_TMP, 0, Serialized)  // _TMP: Temperature
            {
                If ((\_SB.I2C7.PMIC.AVBG == One))
                {
                    \_SB.I2C7.PMIC.GMP2 = Zero
                    If ((\_SB.I2C7.PMIC.AVBD == One))
                    {
                        Return (\_SB.I2C7.PMIC.TMP2)
                    }
                }

                Return (0x0AAC)
            }
        }
    }

    Scope (_SB.PCI0)
    {
        Device (PDRC)
        {
            Name (_HID, EisaId ("PNP0C02") /* PNP Motherboard Resources */)  // _HID: Hardware ID
            Name (_UID, One)  // _UID: Unique ID
            Name (BUF0, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0xE0000000,         // Address Base
                    0x10000000,         // Address Length
                    )
                Memory32Fixed (ReadWrite,
                    0xFED01000,         // Address Base
                    0x00001000,         // Address Length
                    )
                Memory32Fixed (ReadWrite,
                    0xFED03000,         // Address Base
                    0x00001000,         // Address Length
                    )
                Memory32Fixed (ReadWrite,
                    0xFED04000,         // Address Base
                    0x00001000,         // Address Length
                    )
                Memory32Fixed (ReadWrite,
                    0xFED0C000,         // Address Base
                    0x00004000,         // Address Length
                    )
                Memory32Fixed (ReadWrite,
                    0xFED08000,         // Address Base
                    0x00001000,         // Address Length
                    )
                Memory32Fixed (ReadWrite,
                    0xFED1C000,         // Address Base
                    0x00001000,         // Address Length
                    )
                Memory32Fixed (ReadOnly,
                    0xFEE00000,         // Address Base
                    0x00100000,         // Address Length
                    )
                Memory32Fixed (ReadWrite,
                    0xFEF00000,         // Address Base
                    0x00100000,         // Address Length
                    )
            })
        }
    }

    Method (BRTN, 1, Serialized)
    {
        If (((DID1 & 0x0F00) == 0x0400))
        {
            Notify (\_SB.PCI0.GFX0.DD01, Arg0)
        }

        If (((DID2 & 0x0F00) == 0x0400))
        {
            Notify (\_SB.PCI0.GFX0.DD02, Arg0)
        }

        If (((DID3 & 0x0F00) == 0x0400))
        {
            Notify (\_SB.PCI0.GFX0.DD03, Arg0)
        }

        If (((DID4 & 0x0F00) == 0x0400))
        {
            Notify (\_SB.PCI0.GFX0.DD04, Arg0)
        }

        If (((DID5 & 0x0F00) == 0x0400))
        {
            Notify (\_SB.PCI0.GFX0.DD05, Arg0)
        }

        If (CondRefOf (NDN3))
        {
            NDN3 (Arg0)
        }
    }

    Scope (_SB.I2C3)
    {
        Name (AVBL, Zero)
        Method (_REG, 2, NotSerialized)  // _REG: Region Availability
        {
            If ((Arg0 == 0x09))
            {
                AVBL = Arg1
            }
        }

        Name (FSAW, ResourceTemplate ()
        {
            I2cSerialBus (0x0025, ControllerInitiated, 0x00061A80,
                AddressingMode7Bit, "\\_SB.I2C3",
                0x00, ResourceConsumer, ,
                )
        })
        OperationRegion (FSAO, GenericSerialBus, Zero, 0x0100)
        Field (FSAO, BufferAcc, NoLock, Preserve)
        {
            Connection (FSAW), 
            Offset (0x02), 
            AccessAs (BufferAcc, AttribByte), 
            FSIM,   8
        }

        Field (FSAO, BufferAcc, NoLock, Preserve)
        {
            Connection (FSAW), 
            Offset (0x03), 
            AccessAs (BufferAcc, AttribByte), 
            FSIN,   8
        }

        Field (FSAO, BufferAcc, NoLock, Preserve)
        {
            Connection (FSAW), 
            Offset (0x07), 
            AccessAs (BufferAcc, AttribByte), 
            FSRC,   8
        }

        Field (FSAO, BufferAcc, NoLock, Preserve)
        {
            Connection (FSAW), 
            Offset (0x0A), 
            AccessAs (BufferAcc, AttribByte), 
            FSDT,   8
        }

        Field (FSAO, BufferAcc, NoLock, Preserve)
        {
            Connection (FSAW), 
            Offset (0x13), 
            AccessAs (BufferAcc, AttribByte), 
            FSMS,   8
        }
    }

    Scope (_SB.I2C1)
    {
        Device (SMFG)
        {
            Name (_HID, "MAX17047" /* Fuel Gauge Controller */)  // _HID: Hardware ID
            Name (_CID, "MAX17047" /* Fuel Gauge Controller */)  // _CID: Compatible ID
            Name (_DDN, "Fuel Gauge Controller")  // _DDN: DOS Device Name
            Name (RBUF, ResourceTemplate ()
            {
                I2cSerialBus (0x0036, ControllerInitiated, 0x000186A0,
                    AddressingMode7Bit, "\\_SB.I2C1",
                    0x00, ResourceConsumer, ,
                    )
                GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullDefault, 0x0000,
                    "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0012
                    }
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Return (RBUF) /* \_SB_.I2C1.SMFG.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (Zero)
            }
        }

        Device (SMCG)
        {
            Name (_HID, "SMB0349" /* Charger */)  // _HID: Hardware ID
            Name (_CID, "SMB0349" /* Charger */)  // _CID: Compatible ID
            Name (_DDN, "Charger")  // _DDN: DOS Device Name
            Name (RBUF, ResourceTemplate ()
            {
                I2cSerialBus (0x0035, ControllerInitiated, 0x000186A0,
                    AddressingMode7Bit, "\\_SB.I2C1",
                    0x00, ResourceConsumer, ,
                    )
                GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullDefault, 0x0000,
                    "\\_SB.GPO2", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0002
                    }
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Return (RBUF) /* \_SB_.I2C1.SMCG.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (Zero)
            }
        }

        Name (UMPC, ResourceTemplate ()
        {
            I2cSerialBus (0x0078, ControllerInitiated, 0x000186A0,
                AddressingMode7Bit, "\\_SB.I2C1",
                0x00, ResourceConsumer, ,
                )
        })
        Name (AVBL, Zero)
        Method (_REG, 2, NotSerialized)  // _REG: Region Availability
        {
            If ((Arg0 == 0x09))
            {
                AVBL = Arg1
            }
        }

        OperationRegion (DVUM, GenericSerialBus, Zero, 0x0100)
        Field (DVUM, BufferAcc, NoLock, Preserve)
        {
            Connection (UMPC), 
            AccessAs (BufferAcc, AttribBytes (0x39)), 
            FGC0,   8
        }

        Field (DVUM, BufferAcc, NoLock, Preserve)
        {
            Connection (UMPC), 
            Offset (0x2F), 
            AccessAs (BufferAcc, AttribByte), 
            FL2F,   8
        }

        Field (DVUM, BufferAcc, NoLock, Preserve)
        {
            Connection (UMPC), 
            Offset (0x30), 
            AccessAs (BufferAcc, AttribBytes (0x04)), 
            FL30,   8
        }

        Field (DVUM, BufferAcc, NoLock, Preserve)
        {
            Connection (UMPC), 
            Offset (0x4E), 
            AccessAs (BufferAcc, AttribByte), 
            FL4E,   8
        }

        Field (DVUM, BufferAcc, NoLock, Preserve)
        {
            Connection (UMPC), 
            Offset (0x4F), 
            AccessAs (BufferAcc, AttribByte), 
            FL4F,   8
        }

        Field (DVUM, BufferAcc, NoLock, Preserve)
        {
            Connection (UMPC), 
            Offset (0x50), 
            AccessAs (BufferAcc, AttribByte), 
            FL50,   8, 
            FL51,   8, 
            FL52,   8, 
            FL53,   8
        }

        Field (DVUM, BufferAcc, NoLock, Preserve)
        {
            Connection (UMPC), 
            Offset (0x34), 
            AccessAs (BufferAcc, AttribBytes (0x05)), 
            THRM,   8
        }

        Device (BATC)
        {
            Name (_HID, EisaId ("PNP0C0A") /* Control Method Battery */)  // _HID: Hardware ID
            Name (_UID, One)  // _UID: Unique ID
            Name (BCCC, 0x80)
            Name (BCCE, One)
            Name (BCCV, 0x37)
            Name (BCCL, 0xFFFFFFFF)
            Name (BCLP, 0x1004)
            Name (DSCP, 0x1004)
            Name (DSVO, 0x0EA6)
            Name (BTPC, Zero)
            Name (SOCC, Zero)
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
                I2C1
            })
            Name (BFFG, Buffer (0x40)
            {
                 0xFF                                             /* . */
            })
            CreateByteField (BFFG, Zero, STAT)
            CreateByteField (BFFG, One, LEN)
            CreateWordField (BFFG, 0x02, CNTL)
            CreateWordField (BFFG, 0x04, ATRA)
            CreateWordField (BFFG, 0x06, ARTE)
            CreateWordField (BFFG, 0x08, TEMP)
            CreateWordField (BFFG, 0x0A, VOLT)
            CreateWordField (BFFG, 0x0C, FLAG)
            CreateWordField (BFFG, 0x0E, NACT)
            CreateWordField (BFFG, 0x10, FACT)
            CreateWordField (BFFG, 0x12, RECT)
            CreateWordField (BFFG, 0x14, FCCT)
            CreateWordField (BFFG, 0x16, AVRC)
            CreateWordField (BFFG, 0x18, TTET)
            CreateWordField (BFFG, 0x1A, TTFL)
            CreateWordField (BFFG, 0x1C, STDC)
            CreateWordField (BFFG, 0x1E, STTE)
            CreateWordField (BFFG, 0x20, MALC)
            CreateWordField (BFFG, 0x22, MLTE)
            CreateWordField (BFFG, 0x24, AVEE)
            CreateWordField (BFFG, 0x26, AVEP)
            CreateWordField (BFFG, 0x28, TECP)
            CreateWordField (BFFG, 0x2A, DSSP)
            CreateWordField (BFFG, 0x2C, CYLC)
            CreateWordField (BFFG, 0x2E, SOCH)
            CreateByteField (BFFG, 0x30, CHST)
            CreateByteField (BFFG, 0x31, CHCU)
            CreateDWordField (BFFG, 0x32, BTRP)
            CreateByteField (BFFG, 0x36, SKT0)
            CreateWordField (BFFG, 0x37, ST00)
            CreateWordField (BFFG, 0x39, ST01)
            Name (BUFF, Buffer (0x03)
            {
                 0x00, 0x01, 0x00                                 /* ... */
            })
            CreateByteField (BUFF, Zero, BYAT)
            CreateByteField (BUFF, 0x02, DATA)
            Name (BUF1, Buffer (0x06)
            {
                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00               /* ...... */
            })
            CreateByteField (BUF1, Zero, BSTA)
            CreateByteField (BUF1, One, BLEN)
            CreateDWordField (BUF1, 0x02, DAT1)
            Name (BIXP, Package (0x14)
            {
                Zero, 
                One, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                One, 
                0xFFFFFFFF, 
                0x0A, 
                0x04, 
                Zero, 
                0x00017318, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                0x88B8, 
                0x61A8, 
                One, 
                One, 
                "SR Real Battery", 
                "123456789", 
                "LION", 
                "Intel SR 1"
            })
            Name (BSTP, Package (0x04)
            {
                Zero, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                0xFFFFFFFF
            })
            Method (_BIX, 0, NotSerialized)  // _BIX: Battery Information Extended
            {
                If ((AVBL == One))
                {
                    BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                    If ((STAT != One))
                    {
                        If ((CYLC != BCCL))
                        {
                            BCCL = CYLC /* \_SB_.I2C1.BATC.CYLC */
                            BCLP = FCCT /* \_SB_.I2C1.BATC.FCCT */
                        }

                        Index (BIXP, 0x03) = BCLP /* \_SB_.I2C1.BATC.BCLP */
                        Index (BIXP, 0x08) = CYLC /* \_SB_.I2C1.BATC.CYLC */
                    }

                    If ((DSSP != Zero))
                    {
                        DSCP = DSSP /* \_SB_.I2C1.BATC.DSSP */
                    }
                }

                Index (BIXP, 0x02) = DSCP /* \_SB_.I2C1.BATC.DSCP */
                Index (BIXP, 0x05) = DSVO /* \_SB_.I2C1.BATC.DSVO */
                Divide (DSCP, 0x0A, Local0, Local1)
                Index (BIXP, 0x06) = Local1
                Divide (DSCP, 0x14, Local0, Local1)
                Index (BIXP, 0x07) = Local1
                Return (BIXP) /* \_SB_.I2C1.BATC.BIXP */
            }

            Method (_BST, 0, NotSerialized)  // _BST: Battery Status
            {
                If ((AVBL == One))
                {
                    BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                    If ((STAT != One))
                    {
                        Local0 = (CHST >> 0x04)
                        Local0 &= 0x03
                        If (((Local0 == One) || (Local0 == 0x02)))
                        {
                            Local1 = 0x02
                        }

                        If ((Local0 == Zero))
                        {
                            Local1 = One
                        }

                        If ((Local0 == 0x03))
                        {
                            Local1 = Zero
                        }

                        Index (BSTP, Zero) = Local1
                        Local1 = AVRC /* \_SB_.I2C1.BATC.AVRC */
                        If ((Local1 & 0x8000))
                        {
                            Local1 -= 0xFFFF
                        }

                        Index (BSTP, One) = Local1
                        Index (BSTP, 0x02) = RECT /* \_SB_.I2C1.BATC.RECT */
                        Index (BSTP, 0x03) = VOLT /* \_SB_.I2C1.BATC.VOLT */
                        SOCC = SOCH /* \_SB_.I2C1.BATC.SOCH */
                        BUFF = FL53 /* \_SB_.I2C1.FL53 */
                        If ((BYAT != One))
                        {
                            If ((BCCE == One))
                            {
                                DATA |= One
                                FL53 = BUFF /* \_SB_.I2C1.BATC.BUFF */
                            }
                            Else
                            {
                                DATA &= 0xFE
                                FL53 = BUFF /* \_SB_.I2C1.BATC.BUFF */
                            }
                        }
                    }
                }

                Return (BSTP) /* \_SB_.I2C1.BATC.BSTP */
            }

            Method (CBCC, 1, NotSerialized)
            {
                If ((AVBL == One))
                {
                    BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                    If ((STAT != One))
                    {
                        DATA = Arg0
                        FL2F = BUFF /* \_SB_.I2C1.BATC.BUFF */
                    }
                }
            }

            Method (INTR, 0, NotSerialized)
            {
                If ((AVBL == One))
                {
                    BUFF = FL4F /* \_SB_.I2C1.FL4F */
                    If ((BYAT != One))
                    {
                        Return (DATA) /* \_SB_.I2C1.BATC.DATA */
                    }

                    Return (0xFF)
                }

                Return (0xFF)
            }

            Method (_BTP, 1, NotSerialized)  // _BTP: Battery Trip Point
            {
                BTPC = Arg0
                ADBG ("BTP")
                ADBG (Arg0)
                If ((AVBL == One))
                {
                    DAT1 = Arg0
                    BLEN = 0x04
                    FL30 = BUF1 /* \_SB_.I2C1.BATC.BUF1 */
                }

                BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                ADBG (RECT)
            }

            Method (_BTM, 1, NotSerialized)  // _BTM: Battery Time
            {
                If ((Arg0 > 0x7530))
                {
                    Return (Zero)
                }

                If ((AVBL == One))
                {
                    BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                    If ((STAT != One))
                    {
                        If ((Arg0 == Zero))
                        {
                            Local0 = (TTET * 0x3C)
                            Return (Local0)
                        }

                        Local0 = (RECT * 0x0E10)
                        Divide (Local0, Arg0, Local1, Local2)
                        Return (Local2)
                    }
                }

                Return (0xFFFFFFFF)
            }

            Method (_BCT, 1, NotSerialized)  // _BCT: Battery Charge Time
            {
                If (((Arg0 > 0x64) || (Arg0 < One)))
                {
                    Return (Zero)
                }

                If ((AVBL == One))
                {
                    BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                    If ((STAT != One))
                    {
                        If ((Arg0 < RECT))
                        {
                            Return (Zero)
                        }

                        Local1 = AVRC /* \_SB_.I2C1.BATC.AVRC */
                        If ((Local1 & 0x8000))
                        {
                            Return (Zero)
                        }

                        Local0 = (BCLP * Arg0)
                        Local0 -= RECT /* \_SB_.I2C1.BATC.RECT */
                        Local0 *= 0x0E10
                        Divide (Local0, Local1, Local2, Local3)
                        Return (Local3)
                    }
                }

                Return (0xFFFFFFFF)
            }

            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If ((Arg0 == ToUUID ("4c2067e3-887d-475c-9720-4af1d3ed602e") /* Battery Thermal Limit */))
                {
                    If ((Arg2 == 0x02))
                    {
                        If ((Arg1 == Zero))
                        {
                            Return (Buffer (One)
                            {
                                 0x00                                             /* . */
                            })
                        }
                    }
                }

                Return (Zero)
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((AVBL == One))
                {
                    BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                    If ((STAT != Zero))
                    {
                        Return (Zero)
                    }

                    If ((BDID == 0x04))
                    {
                        If ((FBID < 0x02))
                        {
                            Return (0x1F)
                        }
                    }

                    BUFF = FL4E /* \_SB_.I2C1.FL4E */
                    If ((BYAT == Zero))
                    {
                        If ((DATA == 0x02))
                        {
                            Return (0x1F)
                        }

                        Return (Zero)
                    }

                    Return (Zero)
                }

                Return (Zero)
            }

            Method (_PCL, 0, NotSerialized)  // _PCL: Power Consumer List
            {
                Return (_SB) /* \_SB_ */
            }

            Method (PSOC, 0, NotSerialized)
            {
                Return (SOCC) /* \_SB_.I2C1.BATC.SOCC */
            }

            Method (PMAX, 0, NotSerialized)
            {
                If ((AVBL == One))
                {
                    BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                    If ((STAT != One))
                    {
                        Local1 = MALC /* \_SB_.I2C1.BATC.MALC */
                        If ((Local1 & 0x8000))
                        {
                            Local1 -= 0xFFFF
                        }

                        Local1 *= DSVO
                        Return (Local1)
                    }
                }

                Return (Zero)
            }

            Method (VMIN, 0, NotSerialized)
            {
                Return (0x0DAC)
            }

            Method (APWR, 0, NotSerialized)
            {
                Return (0x0365C040)
            }

            Method (NPWR, 0, NotSerialized)
            {
                Local0 = APWR ()
                If ((AVBL == One))
                {
                    BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                    If ((STAT != One))
                    {
                        Local1 = AVRC /* \_SB_.I2C1.BATC.AVRC */
                        If ((Local1 & 0x8000))
                        {
                            Local1 -= 0xFFFF
                        }

                        Local2 = (VOLT * Local1)
                        Local0 -= Local2
                        Return (Local0)
                    }
                }

                Return (Local0)
            }

            Method (PSRC, 0, NotSerialized)
            {
                If ((AVBL == One))
                {
                    BFFG = FGC0 /* \_SB_.I2C1.FGC0 */
                    If ((STAT != One))
                    {
                        Local0 = CHST /* \_SB_.I2C1.BATC.CHST */
                        ADBG ("BATC.PSRC")
                        ADBG (Local0)
                        Local0 >>= 0x06
                        Local0 &= 0x03
                        If ((Local0 == Zero))
                        {
                            Return (Zero)
                        }

                        If ((Local0 == 0x02))
                        {
                            Return (One)
                        }

                        If ((Local0 == One))
                        {
                            Return (0x02)
                        }

                        If ((Local0 == 0x03))
                        {
                            Return (0x04)
                        }
                    }
                }

                Return (One)
            }

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

            Method (ARTG, 0, NotSerialized)
            {
                Return (0x0365C040)
            }
        }
    }

    Scope (_SB)
    {
        Device (ADP1)
        {
            Name (_HID, "ACPI0003" /* Power Source Device */)  // _HID: Hardware ID
            Method (_PSR, 0, NotSerialized)  // _PSR: Power Source
            {
                If (CondRefOf (\_SB.I2C1.BATC, Local1))
                {
                    Local0 = ^^I2C1.BATC.PSRC ()
                    If ((Local0 == One))
                    {
                        Return (One)
                    }
                    Else
                    {
                        Return (Zero)
                    }
                }

                Return (One)
            }

            Method (_PCL, 0, NotSerialized)  // _PCL: Power Consumer List
            {
                Return (_SB) /* \_SB_ */
            }
        }
    }
}


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [WM5102/ARIZONA] spi driver needs to support ACPI
  2015-06-04  7:23               ` Christian Hartmann
@ 2015-06-04 14:57                 ` Pierre-Louis Bossart
  0 siblings, 0 replies; 9+ messages in thread
From: Pierre-Louis Bossart @ 2015-06-04 14:57 UTC (permalink / raw)
  To: Christian Hartmann; +Cc: alsa-devel

On 6/4/15 2:23 AM, Christian Hartmann wrote:
> hi,
>
> her is the dsdt.dsl in readable format (looks better)

So this confirms my initial assertion that whoever wrote the BIOS has a 
limited understanding of ACPI. WM5102 isn't a well-formed _HID, the 
prefix *has* to be a 4-letter ACPI ID or a 4-hex-number PCI ID. the code 
will work but violates the rules of the standard.

At any rate, you would indeed to add this string in the table in 
sst-acpi and add a reference to a machine driver (e.g. byt-wm5102) to 
get your sound card registered.

>
> 2015-06-03 16:59 GMT+02:00 Pierre-Louis Bossart
> <pierre-louis.bossart@linux.intel.com>:
>> On 6/3/15 2:50 AM, Christian Hartmann wrote:
>>>
>>> hi,
>>>
>>> thanks Pierre-Luis,
>>>
>>> I attach the DSDT table in ASM format to get this device working as
>>> soon as possible.
>>
>>
>> this format is unreadable, can you extract the plain DSL instead, e.g. with
>> iasl -d dsdt.dat -> extracts dsdt.dsl with only the code in 'human-readable'
>> format.
>>
>>
>>>
>>> By the way, I looked yesterday into the baytrail code (sound/soc/intel/sst
>>> )
>>> and I added this WM510205 codec.... but I do not know if I have it
>>> done correctly... currently I test my latest changes, seems to not
>>> work as expected yet.
>>>
>>>
>>> cheers
>>> chris
>>>
>>>
>>> 2015-06-02 20:13 GMT+02:00 Pierre-Louis Bossart
>>> <pierre-louis.bossart@linux.intel.com>:
>>>>
>>>> On 06/02/2015 03:34 AM, Christian Hartmann wrote:
>>>>>
>>>>> hi list again,
>>>>>
>>>>> I have patched the torvalds/master branch currently rc6
>>>>> and I have no NULL pointer exception anymore.
>>>>>
>>>>> I will send each patch separately
>>>>>
>>>>> Of course no (working) soundcard yet..
>>>>>
>>>>> so let be try to describe what is actually open or resolved for me:
>>>>>
>>>>> * the spi master 37622 (pxa2xx) does not fail to add the SPI slave
>>>>> spi-WM510205
>>>>> pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00
>>>>>
>>>>> * ALSA device list: no soundcards found
>>>>> * in dmesg I found two message indicating that something seems to be
>>>>> missing yet:
>>>>>
>>>>> sst-acpi 80860F28:00: No matching ASoC machine driver found
>>>>> intel-sst-acpi 80860F28:00: No matching machine driver found
>>>>>
>>>>>
>>>>> snip of dmesg 4.1.0.42-rc6
>>>>>
>>>>>
>>>>> [    6.075170] sst-acpi 80860F28:00: No matching ASoC machine driver
>>>>> found
>>>>> [    6.106787] pxa2xx-spi 80860F0E:00: no DMA channels available, using
>>>>> PIO
>>>>> [    6.106865] pxa2xx-spi 80860F0E:00: registered master spi32766
>>>>> (dynamic)
>>>>> [    6.107058] spi spi-WM510205:00: 8333333 Hz actual, PIO
>>>>> [    6.107065] spi spi-WM510205:00: setup mode 0, 8 bits/w, 8000000 Hz
>>>>> max --> 0
>>>>> [    6.107151] pxa2xx-spi 80860F0E:00: registered child spi-WM510205:00
>>>>> [    6.114510] rfkill_gpio LNV4752:00: GPIO lookup for consumer reset
>>>>> [    6.114519] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
>>>>> [    6.114526] acpi LNV4752:00: GPIO: looking up reset-gpios
>>>>> [    6.114533] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 0 0 0
>>>>> [    6.114607] no flags found for reset
>>>>> [    6.114619] rfkill_gpio LNV4752:00: GPIO lookup for consumer shutdown
>>>>> [    6.114623] rfkill_gpio LNV4752:00: using ACPI for GPIO lookup
>>>>> [    6.114628] acpi LNV4752:00: GPIO: looking up shutdown-gpios
>>>>> [    6.114633] acpi LNV4752:00: GPIO: _DSD returned LNV4752:00 3 1 0 0
>>>>> [    6.114669] acpi LNV4752:00: GPIO: looking up shutdown-gpio
>>>>> [    6.114675] acpi LNV4752:00: GPIO: looking up 0 in _CRS
>>>>> [    6.114711] gpio-411 (reset): gpiod_request: status -16
>>>>> [    6.114849] rfkill_gpio LNV4752:00: LNV4752:00 device registered.
>>>>> [    6.247784] intel_sst_acpi 80860F28:00: No matching machine driver
>>>>> found
>>>>>
>>>>>
>>>>> I have grepped the string 80860F28 in the ACPI DSDT table (->
>>>>> dsdt.dsl) and found
>>>>>
>>>>>       {
>>>>>           Device (LPEA)
>>>>>           {
>>>>>               Name (_ADR, Zero)  // _ADR: Address
>>>>>               Name (_HID, "80860F28" /* Intel SST Audio DSP */)  //
>>>>> _HID: Hardware ID
>>>>>               Name (_CID, "80860F28" /* Intel SST Audio DSP */)  //
>>>>> _CID: Compatible ID
>>>>>               Name (_DDN, "Intel(R) Low Power Audio Controller -
>>>>> 80860F28")  // _DDN: DOS Device Name
>>>>>               Name (_SUB, "17AA7004")  // _SUB: Subsystem ID
>>>>>               Name (_UID, One)  // _UID: Unique ID
>>>>>               Name (_DEP, Package (0x01)  // _DEP: Dependencies
>>>>>               {
>>>>>                   ^SPI1.AUDI
>>>>>               })
>>>>>               Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
>>>>>               {
>>>>>                   PLPE
>>>>>               })
>>>>>               Method (_STA, 0, NotSerialized)  // _STA: Status
>>>>>               {
>>>>>                   If (LAnd (LEqual (LPEE, 0x02), LEqual (LPED, Zero)))
>>>>>                   {
>>>>>                       Return (0x0F)
>>>>>                   }
>>>>>
>>>>>                   Return (Zero)
>>>>>               }
>>>>>
>>>>> So how to bind the intel_sst_acpi with the WM5102 arizona coded and
>>>>> its hub named arizone ???
>>>>>
>>>>> Any suggestions or new directions?
>>>>
>>>>
>>>> In your DSDT table, you need to leave the LPEA device alone. this is
>>>> Intel only
>>>>
>>>> You will need to have a second device for your codec that is either a
>>>> child of the I2C (or SPI?) controllers. This second device will have an HID
>>>> that you need to include in the sst-acpi.c code. when the LPEA driver
>>>> starts, it will look if this codec HID is present and if yes load the
>>>> relevant machine driver and firmware.
>>>>
>>>> see for example the baytrail code, it uses the codec ID to identify which
>>>> machine driver is needed. this is where you would need to add the wolfson
>>>> HID.
>>>>
>>>> static struct sst_acpi_mach baytrail_machines[] = {
>>>>           { "10EC5640", "byt-rt5640",
>>>> "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
>>>>           { "193C9890", "byt-max98090",
>>>> "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
>>>>           {}
>>>> };
>>>>
>>>>
>>>> Maybe you can share your DSDT table (factory settings) if you want more
>>>> help.
>>>> Also note that HIDs are specified based on rules defined by uefi.org, the
>>>> "WM5102" does not follow any of the usual conventions. My guess is that the
>>>> HID should be prefixed by the Wolfson PCI vendor ID.
>>>>
>>>>
>>>>> ....
>>>>>
>>>>>
>>>>> cheers
>>>>> chris
>>>>>
>>>>>
>>>>> 2015-05-19 15:39 GMT+02:00 Christian Hartmann <cornogle@googlemail.com>:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> at the moment I am totally confused. I thought adding an ACPI ID is
>>>>>> trivial, but it is not.
>>>>>>
>>>>>> I have again a null pointer exception in arizona_spi_probe()
>>>>>>
>>>>>> could it be with the new num_chipselect value in spi-pxa2xx.c ??
>>>>>> I attach the trace of the last try
>>>>>>
>>>>>> Any hints or tips are welcome.
>>>>>>
>>>>>> cheers
>>>>>> chris
>>>>>>
>>>>>> 2015-05-19 11:04 GMT+02:00 Christian Hartmann
>>>>>> <cornogle@googlemail.com>:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> so the ACPI id string, which I want to add to arizona-spi.c should be
>>>>>>>
>>>>>>> WM510205 ??
>>>>>>>
>>>>>>> I have changed the ACPI string to
>>>>>>>
>>>>>>> {"WM510205", WM5102},
>>>>>>>
>>>>>>> now and give it a try.
>>>>>>>
>>>>>>> cheers
>>>>>>> chris
>>>>>>>
>>>>>>> 2015-05-18 18:29 GMT+02:00 Pierre-Louis Bossart
>>>>>>> <pierre-louis.bossart@linux.intel.com>:
>>>>>>>>
>>>>>>>> On 5/15/15 4:16 AM, Christian Hartmann wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi list,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I need ACPI support for the arizona-core / arizona-spi driver for
>>>>>>>>> the
>>>>>>>>> ACPI ID WM5102.
>>>>>>>>> This audio codec is build into the Lenovo Yoga 851F. This device is
>>>>>>>>> a
>>>>>>>>> 32Bit (UEFI) system
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://support.lenovo.com/de/de/products/tablets/yoga-series/yoga-tablet-2-851
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I have tested with vanilla kernels from kernel.org 3.19.y ,4.0.y and
>>>>>>>>> master (from torvalds) currently its 4.1.0-rc3. As distribution I am
>>>>>>>>> working with Fedora / Fedlet was the initial install image.
>>>>>>>>>
>>>>>>>>> With all vanilla kernels I got at first an error message from
>>>>>>>>> spi32766:
>>>>>>>>>
>>>>>>>>> [ 0.296297] pxa2xx-spi 80860F0E:00: cs1 >= max 1
>>>>>>>>> [ 0.296311] spi_master spi32766: failed to add SPI device
>>>>>>>>> WM510205:00 from ACPI
>>>>>>>>>
>>>>>>>>> so I have at first patched as suggested by broonie the arizona-core
>>>>>>>>>
>>>>>>>>> commit 48203a0fede057d6a8c5f6872c53326395350f45
>>>>>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>>>>>> Date:   Mon May 11 13:35:43 2015 +0200
>>>>>>>>>
>>>>>>>>>        spi-pxa2xx : raise chipselect
>>>>>>>>>
>>>>>>>>>        Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>>>>>
>>>>>>>>> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
>>>>>>>>> index e3223ac..9c919ea 100644
>>>>>>>>> --- a/drivers/spi/spi-pxa2xx.c
>>>>>>>>> +++ b/drivers/spi/spi-pxa2xx.c
>>>>>>>>> @@ -1279,7 +1279,7 @@ pxa2xx_spi_acpi_get_pdata(struct
>>>>>>>>> platform_device
>>>>>>>>> *pdev)
>>>>>>>>>            if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id,
>>>>>>>>> 0,
>>>>>>>>> &devid))
>>>>>>>>>                    ssp->port_id = devid;
>>>>>>>>>
>>>>>>>>> -       pdata->num_chipselect = 1;
>>>>>>>>> +       pdata->num_chipselect = 20;
>>>>>>>>>            pdata->enable_dma = true;
>>>>>>>>>
>>>>>>>>>            return pdata;
>>>>>>>>>
>>>>>>>>> This leds the spi master do the further ACPI configuration and
>>>>>>>>> inital
>>>>>>>>> setup for the arizona-spi device, but adding the ACPI ID to it
>>>>>>>>> does not work yet as expected:
>>>>>>>>>
>>>>>>>>> The current last patchset on top of master is
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>>>>>> Date:   Wed May 13 11:36:25 2015 +0200
>>>>>>>>>
>>>>>>>>>        arizona : added ACPI id of wm5102 to SPI driver, too
>>>>>>>>>
>>>>>>>>>        Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>>>>>
>>>>>>>>> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
>>>>>>>>> index 1e845f6..c19a4c1 100644
>>>>>>>>> --- a/drivers/mfd/arizona-spi.c
>>>>>>>>> +++ b/drivers/mfd/arizona-spi.c
>>>>>>>>> @@ -17,6 +17,7 @@
>>>>>>>>>     #include <linux/regulator/consumer.h>
>>>>>>>>>     #include <linux/slab.h>
>>>>>>>>>     #include <linux/spi/spi.h>
>>>>>>>>> +#include <linux/acpi.h>
>>>>>>>>>     #include <linux/of.h>
>>>>>>>>>
>>>>>>>>>     #include <linux/mfd/arizona/core.h>
>>>>>>>>> @@ -82,6 +83,15 @@ static int arizona_spi_remove(struct spi_device
>>>>>>>>> *spi)
>>>>>>>>>            return 0;
>>>>>>>>>     }
>>>>>>>>>
>>>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>>>>>>> +               { "WM5102", 0},
>>>>>>>>> +               { "WM510205", 0},
>>>>>>>>> +               { },
>>>>>>>>> +};
>>>>>>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>>>>>>> +#endif
>>>>>>>>> +
>>>>>>>>>     static const struct spi_device_id arizona_spi_ids[] = {
>>>>>>>>>            { "wm5102", WM5102 },
>>>>>>>>>            { "wm5110", WM5110 },
>>>>>>>>> @@ -96,6 +106,9 @@ static struct spi_driver arizona_spi_driver = {
>>>>>>>>>                    .owner  = THIS_MODULE,
>>>>>>>>>                    .pm     = &arizona_pm_ops,
>>>>>>>>>                    .of_match_table = of_match_ptr(arizona_of_match),
>>>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>>>>>>> +#endif
>>>>>>>>>            },
>>>>>>>>>            .probe          = arizona_spi_probe,
>>>>>>>>>            .remove         = arizona_spi_remove,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> commit 268e21d29c942205e40f749c6d71c77839dc67da
>>>>>>>>> Author: somebody anybody <somebody@foobar.com>
>>>>>>>>> Date:   Wed May 13 11:36:04 2015 +0200
>>>>>>>>>
>>>>>>>>>        arizona : added ACPI id of wm5102 to i2c driver
>>>>>>>>>
>>>>>>>>>        Signed-off-by: somebody anybody <somebody@foobar.com>
>>>>>>>>>
>>>>>>>>> diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
>>>>>>>>> index ff782a5..45ece1b 100644
>>>>>>>>> --- a/drivers/mfd/arizona-i2c.c
>>>>>>>>> +++ b/drivers/mfd/arizona-i2c.c
>>>>>>>>> @@ -18,6 +18,7 @@
>>>>>>>>>     #include <linux/regulator/consumer.h>
>>>>>>>>>     #include <linux/slab.h>
>>>>>>>>>     #include <linux/of.h>
>>>>>>>>> +#include <linux/acpi.h>
>>>>>>>>>
>>>>>>>>>     #include <linux/mfd/arizona/core.h>
>>>>>>>>>
>>>>>>>>> @@ -85,6 +86,15 @@ static int arizona_i2c_remove(struct i2c_client
>>>>>>>>> *i2c)
>>>>>>>>>            return 0;
>>>>>>>>>     }
>>>>>>>>>
>>>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>>>> +static struct acpi_device_id wm5102_acpi_match[] = {
>>>>>>>>> +               { "WM5102", 0},
>>>>>>>>> +               { "WM510205", 0},
>>>>>>>>> +               { },
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Those IDs don't really look like ACPI ones? Isn't there a rule that
>>>>>>>> the _HID
>>>>>>>> is represented by a 4-letter vendor ID followed by part ID? see
>>>>>>>> http://www.uefi.org/PNP_ACPI_Registry
>>>>>>>>
>>>>>>>>
>>>>>>>>> +};
>>>>>>>>> +MODULE_DEVICE_TABLE(acpi, wm5102_acpi_match);
>>>>>>>>> +#endif
>>>>>>>>> +
>>>>>>>>>     static const struct i2c_device_id arizona_i2c_id[] = {
>>>>>>>>>            { "wm5102", WM5102 },
>>>>>>>>>            { "wm5110", WM5110 },
>>>>>>>>> @@ -100,6 +110,9 @@ static struct i2c_driver arizona_i2c_driver = {
>>>>>>>>>                    .owner  = THIS_MODULE,
>>>>>>>>>                    .pm     = &arizona_pm_ops,
>>>>>>>>>                    .of_match_table = of_match_ptr(arizona_of_match),
>>>>>>>>> +#ifdef CONFIG_ACPI
>>>>>>>>> +               .acpi_match_table = ACPI_PTR(wm5102_acpi_match),
>>>>>>>>> +#endif
>>>>>>>>>            },
>>>>>>>>>            .probe          = arizona_i2c_probe,
>>>>>>>>>            .remove         = arizona_i2c_remove,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> with these two patches the local master branch compiles fine, but at
>>>>>>>>> initialzing the arizona-spi driver gots a NULL pointer exception.
>>>>>>>>>
>>>>>>>>> I attach the whole dmesg of 4.1.0-rc3 (build 4.1.0.24-rc3).
>>>>>>>>>
>>>>>>>>> I need some assistance or hints to the right direction, I am looking
>>>>>>>>> myself and I also try what I can, but I think it would be easy peasy
>>>>>>>>> with some experts like here on this list :)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> PS: the message : spi_master spi32766: raised num_chipselect to 20
>>>>>>>>> for
>>>>>>>>> WM510205:00
>>>>>>>>>
>>>>>>>>> is a dev_err() line added to the function static acpi_status
>>>>>>>>> acpi_spi_add_device(), there I had raised the num_chipselect first
>>>>>>>>> (that was wrong, the raise is now done as in the first patch above.
>>>>>>>>> this is only a debug message and will be removed soon)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> PPS: for me it seems that there is a missing 'link' from WM5102 to
>>>>>>>>> the
>>>>>>>>> sst-acpi 80860F28:00 device, which complaints NOW / the first time
>>>>>>>>> with the three patches applied on top on master.... will have a look
>>>>>>>>> into it.
>>>>>>>>>
>>>>>>>>> I hope I got this device working with some more help from you.
>>>>>>>>>
>>>>>>>>> cheers
>>>>>>>>> chris
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Alsa-devel mailing list
>>>>>>>>> Alsa-devel@alsa-project.org
>>>>>>>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>>>>>>>
>>>>>>>
>>>>> _______________________________________________
>>>>> Alsa-devel mailing list
>>>>> Alsa-devel@alsa-project.org
>>>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-06-04 14:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15  9:16 [WM5102/ARIZONA] spi driver needs to support ACPI Christian Hartmann
2015-05-18 16:29 ` Pierre-Louis Bossart
2015-05-19  9:04   ` Christian Hartmann
2015-05-19 13:39     ` Christian Hartmann
2015-06-02  8:34       ` Christian Hartmann
2015-06-02 18:13         ` Pierre-Louis Bossart
     [not found]           ` <CAKor6Tf-SUof0RgQazOEJHnojAcDZq88a-TybD-oYEmS=fLLig@mail.gmail.com>
2015-06-03 14:59             ` Pierre-Louis Bossart
2015-06-04  7:23               ` Christian Hartmann
2015-06-04 14:57                 ` Pierre-Louis Bossart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.