Bug 200707 - I2C controller (AMD PCIe MP2) on Asus VivoBook K505ZA (X505ZA) not working
Summary: I2C controller (AMD PCIe MP2) on Asus VivoBook K505ZA (X505ZA) not working
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: I2C (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Drivers/I2C virtual user
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-01 21:03 UTC by Joshua Strobl
Modified: 2018-09-26 18:50 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.18.0 rc7
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg output (65.52 KB, text/plain)
2018-08-01 21:03 UTC, Joshua Strobl
Details
kernel config (189.51 KB, text/x-mpsub)
2018-08-01 21:09 UTC, Joshua Strobl
Details
i8042 nomux (64.76 KB, text/plain)
2018-08-03 17:07 UTC, Joshua Strobl
Details
dsdt dsl (344.44 KB, text/x-csrc)
2018-08-03 17:10 UTC, Joshua Strobl
Details
dmesg output (4.19-rc4) (65.17 KB, text/plain)
2018-09-21 09:09 UTC, Joshua Strobl
Details
kernel config (4.19-rc4) (191.49 KB, text/plain)
2018-09-21 09:09 UTC, Joshua Strobl
Details
dmesg output (4.19-rc4 with CONFIG_PINCTRL_AMD=y set) (65.20 KB, text/plain)
2018-09-21 09:51 UTC, Joshua Strobl
Details
udevadm info -e output (140.18 KB, text/plain)
2018-09-21 10:10 UTC, Joshua Strobl
Details

Description Joshua Strobl 2018-08-01 21:03:42 UTC
Created attachment 277653 [details]
dmesg output

Recently purchased an Asus VivoBook K505ZA and 4.18 rc7 (nor 4.17.11) is finding my touchpad. Haven't even managed to find out what vendor the touchpad comes from, model, etc. so any guidance is appreciated.

Attached is my dmesg output, xinput and lsusb are below.

xinput:

⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Asus Wireless Radio Control             	id=7	[slave  keyboard (3)]
    ↳ Video Bus                               	id=8	[slave  keyboard (3)]
    ↳ Video Bus                               	id=9	[slave  keyboard (3)]
    ↳ Power Button                            	id=10	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=11	[slave  keyboard (3)]
    ↳ USB2.0 VGA UVC WebCam: USB2.0 V         	id=12	[slave  keyboard (3)]
    ↳ Asus WMI hotkeys                        	id=13	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=14	[slave  keyboard (3)]

lsusb:

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 8087:0a2b Intel Corp. 
Bus 003 Device 003: ID 0408:3050 Quanta Computer, Inc. 
Bus 003 Device 002: ID 058f:6254 Alcor Micro Corp. USB Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Comment 1 Joshua Strobl 2018-08-01 21:09:16 UTC
Created attachment 277655 [details]
kernel config

Attached the kernel configuration I'm using as well. Most Asus laptops appear to have ELAN touchpads (at least when checking for existing kernel bugs), I've verified that I have the appropriate kernel modules enabled, in the event that the X505ZA uses that as well:

CONFIG_MOUSE_PS2_ELANTECH=y
CONFIG_MOUSE_PS2_ELANTECH_SMBUS=y
CONFIG_MOUSE_ELAN_I2C=m
CONFIG_MOUSE_ELAN_I2C_I2C=y
CONFIG_MOUSE_ELAN_I2C_SMBUS=y
CONFIG_TOUCHSCREEN_ELAN=m
CONFIG_HID_ELAN=m
CONFIG_USB_FTDI_ELAN=m
Comment 2 Joshua Strobl 2018-08-02 14:33:15 UTC
I downloaded the Windows 10 drivers from http://dlcdnet.asus.com/pub/ASUS/nb/DriversForWin10/LAN/LAN_Realtek_Win10_64_VERV1002310032017.zip and item.txt specifies:

Vendor:ASUS
Category:Touchpad
Module:ELAN/SA473I-12A4

I did a search for all ELAN listings, specifically checking for [VENDOR_ELAN_PTP], and it came up with the following two files:

_A7991838325E4D8493540C65BD549AC7
_8D26F7BC5C7844BFA110CEF190584044

This listed off:
ELAN1200
ELAN1201
ELAN1202
ELAN1203
ELAN1300
ELAN1301
ELAN2200
ELAN2201
ELAN2202
ELAN2300
ELAN2301
VID_04F3&PID_3067&MI_01&Col02
Comment 3 Dmitry Torokhov 2018-08-03 16:20:21 UTC
ls /sys/bus/i2c/devices ?
Comment 4 Joshua Strobl 2018-08-03 16:25:41 UTC
/sys/bus/i2c/devices
├── i2c-0 -> ../../../devices/platform/AMDI0010:01/i2c-0
├── i2c-1 -> ../../../devices/pci0000:00/0000:00:14.0/i2c-1
├── i2c-2 -> ../../../devices/pci0000:00/0000:00:14.0/i2c-2
├── i2c-3 -> ../../../devices/pci0000:00/0000:00:14.0/i2c-3
├── i2c-4 -> ../../../devices/pci0000:00/0000:00:14.0/i2c-4
├── i2c-5 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/i2c-5
├── i2c-6 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/i2c-6
└── i2c-7 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.0/i2c-7
Comment 5 Dmitry Torokhov 2018-08-03 16:38:41 UTC
OK, so it is not Elan I2C controller and it does not look like I2C HID device either... Unless there is another I2C master for which there is no driver.

Maybe if you post disassembled DSDT we could figure out what device it is.
Comment 6 Joshua Strobl 2018-08-03 16:44:01 UTC
> Maybe if you post disassembled DSDT we could figure out what device it is.

That all went over my head, could you ELI5?
Comment 7 Dmitry Torokhov 2018-08-03 17:01:17 UTC
You probably need to install acpica-tools package, then

mkdir tmp; cd tmp
sudo acpidump -b
iasl -d dsdt.dat

and post dsdt.dsl

Also, why are you booting with i8042.nopnp? Can I see dmesg without it? Also, canyou try i8042.nomux with and without i8042.reset please.
Comment 8 Joshua Strobl 2018-08-03 17:07:31 UTC
Created attachment 277677 [details]
i8042 nomux

Yea sorry, I was just reading up on possible solutions that were reported and attempted with the nopnp option. I've removed it, here's the dmesg with only i8042.nomux. I'll get you the other info shortly.
Comment 9 Joshua Strobl 2018-08-03 17:10:40 UTC
Created attachment 277679 [details]
dsdt dsl
Comment 10 Joshua Strobl 2018-08-03 17:45:36 UTC
I found reference to AMDI0011, which apparently on a Dell Latitude system is used to connect up the touchpad. Immediate search brought up https://bugs.launchpad.net/ubuntu/+source/linux-oem/+bug/1773940, trying to find the patch for that (if needed, unless it's already landed in the kernel?).
Comment 12 Joshua Strobl 2018-08-06 20:40:15 UTC
Tried with the following patches (from July) against 4.18 rc8, no change:

- https://lists.ubuntu.com/archives/kernel-team/2018-July/093951.html
- https://lists.ubuntu.com/archives/kernel-team/2018-July/093952.html
- https://lists.ubuntu.com/archives/kernel-team/2018-July/093953.html

This is with CONFIG_I2C_AMD_MP2=y set
Comment 13 Joshua Strobl 2018-08-09 00:12:38 UTC
Reached out to ASUS support on Facebook, they reported that the touchpad in my laptop should be an ELAN/SA473I-12A6.
Comment 14 Dmitry Torokhov 2018-08-09 00:49:17 UTC
So the touchpad, according to DSDT, should be handled by i2c-hid + hid-multitouch driver. However you need to get your I2C controller working, I'd try reaching to the AMD guys who authored the patches in question and asked them for help.
Comment 15 Kai-Heng Feng 2018-09-21 07:57:45 UTC
Actually the patch was sent to ML, but maintainers haven't reviewed it.

https://patchwork.kernel.org/patch/10597369/
Comment 16 Joshua Strobl 2018-09-21 08:52:05 UTC
Hey Kai-Heng Feng,

Unfortunately with your patch (against 4.19-rc4) my touchpad still does not function. Is there any sort of information I could provide you to help determine the root cause (whether it's the controller, the Elantech touchpad, etc.)?
Comment 17 Kai-Heng Feng 2018-09-21 08:58:47 UTC
Can you attach full dmesg and kernel config?
Comment 18 Joshua Strobl 2018-09-21 09:09:34 UTC
Created attachment 278689 [details]
dmesg output (4.19-rc4)

Here's the dmesg output.
Comment 19 Joshua Strobl 2018-09-21 09:09:59 UTC
Created attachment 278691 [details]
kernel config (4.19-rc4)

And here's the kernel config
Comment 20 Kai-Heng Feng 2018-09-21 09:24:28 UTC
It's likely that the touchpad connects to AMDI0010 instead of AMDI0011.
Please try CONFIG_PINCTRL_AMD=y.
Comment 21 Joshua Strobl 2018-09-21 09:51:31 UTC
Created attachment 278695 [details]
dmesg output (4.19-rc4 with CONFIG_PINCTRL_AMD=y set)

Recompiled with CONFIG_PINCTRL_AMD=y set. No change.
Comment 22 Kai-Heng Feng 2018-09-21 10:01:41 UTC
Can you attach `udevadm info -e`? Thanks!
Comment 23 Joshua Strobl 2018-09-21 10:10:02 UTC
Created attachment 278697 [details]
udevadm info -e output

Here's the output from udevadm info -e
Comment 24 Kai-Heng Feng 2018-09-21 10:18:41 UTC
The one with PNP0C50 is under I2CD, which is AMDI0010.

The system doesn't think PNP0C50 exists. You need to change the _STA under PNP0C50 to return 0x0f,
From:
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (((TPIF != One) || (DSYN && One)))
                {
                    Return (Zero)
                }

                Return (0x0F)
            }

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

And use the newly patched dsdt.
Comment 25 Joshua Strobl 2018-09-21 10:35:31 UTC
Any chance you can link documentation on how I can patch and apply said patched DSDT? Newbie here.
Comment 27 Joshua Strobl 2018-09-21 17:53:22 UTC
Holy smokes, after following your instructions (and the documentation you link) I can confirm that my touchpad now works.

Your assistance, as well as Dmitry's, is greatly appreciated. Is there any way I can raise this issue with Asus so broader Linux support / compatibility can be implemented?
Comment 28 Joshua Strobl 2018-09-21 18:00:22 UTC
(In reply to Joshua Strobl from comment #27)
> Holy smokes, after following your instructions (and the documentation you
> link) I can confirm that my touchpad now works.
> 
> Your assistance, as well as Dmitry's, is greatly appreciated. Is there any
> way I can raise this issue with Asus so broader Linux support /
> compatibility can be implemented?

Assuming Asus is the right upstream to raise this with, of course.
Comment 29 Kai-Heng Feng 2018-09-21 18:17:42 UTC
Yes this issue belongs to Asus. Somehow (TPIF != One) || (DSYN && One) evaluates to true, I guess they intended to write (DSYN & One) instead of (DSYN && One).
Comment 30 Kai-Heng Feng 2018-09-25 15:13:02 UTC
Have you tested the latest BIOS (306)?
Comment 31 Joshua Strobl 2018-09-25 16:19:56 UTC
Can confirm that with BIOS revision 306 it does work. Considering this issue resolved, thank you for all your hard work helping to debug this issue. Will give you or Dmitry the luxury of marking this resolved :D
Comment 32 Dmitry Torokhov 2018-09-26 18:50:03 UTC
With pleasure ;)

Note You need to log in before you can comment on or make changes to this bug.