according to the above analysis, error is happen with the direction is :
in

i found the function to set the direction of  gpio pin  to in:
amd_gpio_direction_input,

and add some pr_err and dump_stack() to the function ,

then dmesg out put like :

[    1.545190] amd_gpio_set_config 
gpio_chip->label:AMDI0030:00,offset:130,config:278
[    1.545191] amd_gpio_direction_input gpio_chip->label:AMDI0030:00,offset:130

=============================amd_gpio_direction_input dump_stack()=====
[    1.545194] CPU: 12 PID: 264 Comm: kworker/12:4 Not tainted 
5.8.13-303.fc33.x86_64 #1
[    1.545194] Hardware name: LENOVO 82B6/LNVNB161216, BIOS EUCN26WW 08/19/2020
[    1.545197] Workqueue: events deferred_probe_work_func
[    1.545198] Call Trace:
[    1.545203]  dump_stack+0x6b/0x88
[    1.545205]  amd_gpio_direction_input+0x57/0x60 [pinctrl_amd]
[    1.545206]  gpiod_direction_input+0x5b/0x170
[    1.545208]  acpi_dev_gpio_irq_get+0x111/0x1b6
[    1.545209]  ? i2c_acpi_find_adapter_by_handle+0x30/0x30
[    1.545210]  i2c_acpi_get_irq+0x81/0x90
[    1.545212]  i2c_device_probe+0x24a/0x280
[    1.545213]  really_probe+0x160/0x400
[    1.545214]  driver_probe_device+0xe1/0x150
[    1.545215]  ? driver_allows_async_probing+0x50/0x50
[    1.545216]  bus_for_each_drv+0x6a/0xa0
[    1.545217]  __device_attach+0xb4/0x1b0
[    1.545218]  bus_probe_device+0x8e/0xa0
[    1.545219]  deferred_probe_work_func+0x77/0xc0
[    1.545220]  process_one_work+0x1b4/0x370
[    1.545221]  worker_thread+0x53/0x3e0
[    1.545222]  ? process_one_work+0x370/0x370
[    1.545223]  kthread+0x11b/0x140
[    1.545224]  ? __kthread_bind_mask+0x60/0x60
[    1.545226]  ret_from_fork+0x22/0x30
============================================================================

then i found the functions

acpi_dev_gpio_irq_get

in in file : drivers/gpio/gpiolib-acpi.c, line 927 (as a function)

and it's comment say:
```
/**
 * acpi_dev_gpio_irq_get() - Find GpioInt and translate it to Linux IRQ number
 * @adev: pointer to a ACPI device to get IRQ from
 * @index: index of GpioInt resource (starting from %0)
 *
 * If the device has one or more GpioInt resources, this function can be
 * used to translate from the GPIO offset in the resource to the Linux IRQ
 * number.
 *
 * The function is idempotent, though each time it runs it will configure GPIO
 * pin direction according to the flags in GpioInt resource.
 *
 * Return: Linux IRQ number (> %0) on success, negative errno on failure.
 */
int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
{
```

each time it runs it will configure GPIO pin direction according to the
flags in GpioInt resource.

in it's body ,by call function gpiod_configure_flags (in  
/drivers/gpio/gpiolib.c)
it call the function  gpiod_direction_input.
so the direction become to :input or in

the problem may be in two places:
1. lenovo 's default value in bios or dsdt is : input or in,or missing . but on 
windows ,it's ok,so ,may be not here.
2. in linux kernel,the default value of the type for gpio pin 's direction ,is 
:input or in

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to xserver-xorg-input-libinput in Ubuntu.
https://bugs.launchpad.net/bugs/1887190

Title:
  MSFT Touchpad not working on Lenovo Legion-5 15ARH05

Status in Pop!_OS:
  New
Status in linux package in Ubuntu:
  Confirmed
Status in xserver-xorg-input-libinput package in Ubuntu:
  Confirmed
Status in linux package in Arch Linux:
  Fix Committed
Status in linux package in Fedora:
  Confirmed
Status in linux package in openSUSE:
  New

Bug description:
  Hello

  The MSFT touchpad of this Lenovo Legion-5 15ARH05 laptop is not reacting at 
all (pointer and click never move when touchpad is touched). This has been 
reported by other users in various websites, with various linux systems 
including other Ubuntu systems, but I saw no launchpad bug so I post one. 
Example of websites covering the issue :
  - https://askubuntu.com/questions/1253830/lenovo-legion-5-touchpad (exactly 
the same laptop)
  - https://www.linux.org/threads/lenovo-legion-5-touchpad.29536/ (similar 
laptop)

  xinput indentifies it as MSFT0001:00 04F3:3140

  Virtual core pointer                          id=2    [master pointer  (3)]
  ⎜   ↳ Virtual core XTEST pointer                      id=4    [slave  pointer 
 (2)]
  ⎜   ↳ MSFT0001:00 04F3:3140 Touchpad                  id=17   [slave  pointer 
 (2)]
  ⎜   ↳ MSFT0001:00 04F3:3140 Mouse                     id=16   [slave  pointer 
 (2)]
  ⎜   ↳ ITE Tech. Inc. ITE Device(8910) Consumer Control        id=12   [slave  
pointer  (2)]
  ⎜   ↳ Logitech USB Optical Mouse                      id=11   [slave  pointer 
 (2)]
  ⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
      ↳ Virtual core XTEST keyboard                     id=5    [slave  
keyboard (3)]
      ↳ Ideapad extra buttons                           id=15   [slave  
keyboard (3)]
      ↳ Power Button                                    id=6    [slave  
keyboard (3)]
      ↳ Integrated Camera: Integrated C                 id=10   [slave  
keyboard (3)]
      ↳ Video Bus                                       id=7    [slave  
keyboard (3)]
      ↳ ITE Tech. Inc. ITE Device(8910) Consumer Control        id=19   [slave  
keyboard (3)]
      ↳ Power Button                                    id=9    [slave  
keyboard (3)]
      ↳ ITE Tech. Inc. ITE Device(8910) Wireless Radio Control  id=13   [slave  
keyboard (3)]
      ↳ ITE Tech. Inc. ITE Device(8910) Keyboard        id=14   [slave  
keyboard (3)]
      ↳ AT Translated Set 2 keyboard                    id=18   [slave  
keyboard (3)]
      ↳ Video Bus                                       id=8    [slave  
keyboard (3)]

  Thanks a lot for your time. It does not help, but I can confirm what
  was reported on askubuntu by another user : the touchpad does work on
  Windows.

  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: linux-image-5.4.0-40-generic 5.4.0-40.44
  ProcVersionSignature: Ubuntu 5.4.0-40.44-generic 5.4.44
  Uname: Linux 5.4.0-40-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.20.11-0ubuntu27.3
  Architecture: amd64
  AudioDevicesInUse:
   USER        PID ACCESS COMMAND
   /dev/snd/controlC0:  nicolas    1567 F.... pulseaudio
   /dev/snd/controlC1:  nicolas    1567 F.... pulseaudio
   /dev/snd/controlC2:  nicolas    1567 F.... pulseaudio
  CasperMD5CheckResult: skip
  CurrentDesktop: ubuntu:GNOME
  Date: Fri Jul 10 20:14:25 2020
  InstallationDate: Installed on 2020-07-02 (8 days ago)
  InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
  MachineType: LENOVO 82B5
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=fr_FR.UTF-8
   SHELL=/bin/bash
  ProcFB: 0 EFI VGA
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-5.4.0-40-generic 
root=UUID=d8898017-2821-434e-ab52-fec76ac93106 ro quiet splash vt.handoff=7
  RelatedPackageVersions:
   linux-restricted-modules-5.4.0-40-generic N/A
   linux-backports-modules-5.4.0-40-generic  N/A
   linux-firmware                            1.187.1
  SourcePackage: linux
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 05/12/2020
  dmi.bios.vendor: LENOVO
  dmi.bios.version: EUCN19WW
  dmi.board.asset.tag: NO Asset Tag
  dmi.board.name: LNVNB161216
  dmi.board.vendor: LENOVO
  dmi.board.version: SDK0J40709 WIN
  dmi.chassis.asset.tag: NO Asset Tag
  dmi.chassis.type: 10
  dmi.chassis.vendor: LENOVO
  dmi.chassis.version: Lenovo Legion 5 15ARH05
  dmi.modalias: 
dmi:bvnLENOVO:bvrEUCN19WW:bd05/12/2020:svnLENOVO:pn82B5:pvrLenovoLegion515ARH05:rvnLENOVO:rnLNVNB161216:rvrSDK0J40709WIN:cvnLENOVO:ct10:cvrLenovoLegion515ARH05:
  dmi.product.family: Legion 5 15ARH05
  dmi.product.name: 82B5
  dmi.product.sku: LENOVO_MT_82B5_BU_idea_FM_Legion 5 15ARH05
  dmi.product.version: Lenovo Legion 5 15ARH05
  dmi.sys.vendor: LENOVO
  --- 
  ProblemType: Bug
  ApportVersion: 2.20.11-0ubuntu27.3
  Architecture: amd64
  CasperMD5CheckResult: skip
  CurrentDesktop: ubuntu:GNOME
  DistroRelease: Ubuntu 20.04
  InstallationDate: Installed on 2020-07-02 (12 days ago)
  InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
  Package: linux (not installed)
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=fr_FR.UTF-8
   SHELL=/bin/bash
  Tags:  focal
  Uname: Linux 5.8.0-050800rc5-generic x86_64
  UnreportableReason: The running kernel is not an Ubuntu kernel
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo
  _MarkForUpload: True

To manage notifications about this bug go to:
https://bugs.launchpad.net/pop-os/+bug/1887190/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to