Re: [PATCH 1/1] Force ELAN06FA touchpad I2C bus freq to 100KHz

R Ha
2025-01-08T09:29:45Z

Hello,

On Tue, Jan 7, 2025 at 11:51 PM Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> There should be Device() node for that too. The ones you listed are just
> child devices connected to that bus.

You're right, after searching for Device nodes I was able to find this
snippet. But it doesn't seem to have anything related to HCNT/LCNT
values either, but maybe they're hidden somewhere.
Thanks for the tip again.

Scope (_SB.PC00)
{
Scope (\_SB.PC00)
{
Method (SOD3, 3, Serialized)
{
OperationRegion (ICB1, SystemMemory, (GPCB () + Arg0), 0x88)
If (Arg1)
{
Field (ICB1, ByteAcc, NoLock, Preserve)
{
Offset (0x84),
PMEC, 8
}

PMEC = 0x03
PMEC |= Zero
}

If ((Arg1 && Arg2))
{
Field (ICB1, AnyAcc, NoLock, Preserve)
{
Offset (0x10),
BAR0, 64
}

BAR0 = Zero
}
}
}

Method (I2CH, 1, Serialized)
{
OperationRegion (ICB1, SystemMemory, Arg0, 0x20)
Field (ICB1, AnyAcc, NoLock, Preserve)
{
Offset (0x10),
BAR0, 64,
BAR1, 64
}

Name (BUF0, ResourceTemplate ()
{
Memory32Fixed (ReadWrite,
0x00000000, // Address Base
0x00001000, // Address Length
_Y2B)
})
Name (BUF1, ResourceTemplate ()
{
Memory32Fixed (ReadWrite,
0x00000000, // Address Base
0x00001000, // Address Length
_Y2C)
})
CreateDWordField (BUF0, \_SB.PC00.I2CH._Y2B._BAS, ADR0) //
_BAS: Base Address
CreateDWordField (BUF1, \_SB.PC00.I2CH._Y2C._BAS, ADR1) //
_BAS: Base Address
ADR0 = (BAR0 & 0xFFFFFFFFFFFFF000)
ADR1 = (BAR1 & 0xFFFFFFFFFFFFF000)
ConcatenateResTemplate (BUF0, BUF1, Local0)
Return (Local0)
}

Device (I2C0)
{
If ((IM00 == 0x02))
{
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Return (I2CH (IC00))
}

Name (_STA, 0x08) // _STA: Status
}

If ((IM00 == One))
{
Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method
{
If (PCIC (Arg0))
{
Return (PCID (Arg0, Arg1, Arg2, Arg3))
}

Return (Buffer (One)
{
0x00 // .
})
}

Method (_PS3, 0, NotSerialized) // _PS3: Power State 3
{
SOD3 (IC00, One, One)
}

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

If (((IM00 == One) || (IM00 == Zero)))
{
Method (_ADR, 0, NotSerialized) // _ADR: Address
{
Return (0x00150000)
}
}
}

[...I2C1-7 nodes removed]

Method (SPIH, 1, Serialized)
{
OperationRegion (ICB1, SystemMemory, Arg0, 0x20)
Field (ICB1, AnyAcc, NoLock, Preserve)
{
Offset (0x10),
BAR0, 64,
BAR1, 64
}

Name (BUF0, ResourceTemplate ()
{
Memory32Fixed (ReadWrite,
0x00000000, // Address Base
0x00001000, // Address Length
_Y2D)
})
Name (BUF1, ResourceTemplate ()
{
Memory32Fixed (ReadWrite,
0x00000000, // Address Base
0x00001000, // Address Length
_Y2E)
})
CreateDWordField (BUF0, \_SB.PC00.SPIH._Y2D._BAS, ADR0) //
_BAS: Base Address
CreateDWordField (BUF1, \_SB.PC00.SPIH._Y2E._BAS, ADR1) //
_BAS: Base Address
ADR0 = (BAR0 & 0xFFFFFFFFFFFFF000)
ADR1 = (BAR1 & 0xFFFFFFFFFFFFF000)
ConcatenateResTemplate (BUF0, BUF1, Local0)
Return (Local0)
}

[...SPI nodes removed]
}