All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Miroslav Bendík" <miroslav@wisdomtech.sk>
To: Wolfram Sang <wsa@kernel.org>,
	"Limonciello, Mario" <mario.limonciello@amd.com>,
	Benjamin Tissoires <btissoir@redhat.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Andrea Ippolito <andrea.ippo@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Alex Hung <alex.hung@canonical.com>,
	Linux I2C <linux-i2c@vger.kernel.org>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	"Shah, Nehal-bakulchandra" <Nehal-bakulchandra.Shah@amd.com>
Subject: Re: Touchpad stickiness on AMD laptops (was Dell Inspiron/XPS)
Date: Wed, 12 Jan 2022 13:21:27 +0100	[thread overview]
Message-ID: <596d6af1-d67c-b9aa-0496-bd898350865c@wisdomtech.sk> (raw)
In-Reply-To: <Yd6SRl7sm8zS85Al@ninjato>

 > IIRC tests done by Miroslav showed that interrupt 7 was used for
 > completing SMBus Block transfers and alike, but not for HostNotify. He
 > suspects this is wired via GPIO somehow.

This is just speculation. It may be routed to GPIO pin, but think it's more
likely that AMD implements host notify. I have looked at windwos drivers and
there is only SMBus driver bundled with synaptics.

Lets look at https://www.intel.com/Assets/PDF/datasheet/290562.pdf 
(PIIX4 from
Intel). There is SMBSLVCNT register (page 152). Last bit (Slave Enable) 
should
enable interrupt on host notify if slave address matches content of SMBSLVC.
This register is described on page 135 (SMBUS SLAVE COMMAND). Registers are
accessible using PCI configuration registers. I have tried this code before
enabling interrupts without success:

pci_write_config_word(dev, SMBSLVC, 0x2c); // synaptics

I don't know if this PDF is relevant for AMD. Newest documentation from AMD,
which i found is:
https://www.amd.com/system/files/TechDocs/55072_AMD_Family_15h_Models_70h-7Fh_BKDG.pdf

This document describes SMBusSlaveControl on same address (0x08) and 
SlaveEnable
looks almost identical.

The interesting part is:

"address that matches the host controller slave port of 10h, a command field
that matches the SMBus slave control register, and a match of corresponding
enabled events"

Slave device should send address 10h automatically. Enabled events can 
be set
using SMBusSlaveEvent register. I have enabled all (set 0xff to 0x0a / 0x0b
registers), but i don't know how to set "command field". There is no 
register
named "command field". Intel has SMBSLVC, but i can't find corresponding
register on AMD.

Constant activity on I2C pins can be repeated host notify request from 
synaptics.

Last interesting fact:

I have recorded register value (except 0x02 and 0x07) after each SMBus
transaction. This is from last 2 transactions:

0200 0004 5801 0000 0fa9 00ff ff00 a8aa
0200 0001 5802 0000 0fa9 40ff ff00 a8aa

Every call has SMBusSlaveEvent (register 0x0a) 0x00 except of last 
command after
which device is initialized. After this call register has value 0x40. I have
written 0xff to this register to enable all events in probe function. I 
don't
know why it's 0x00 until last transaction.


  reply	other threads:[~2022-01-12 12:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAGhUXvBw4rzCQrqttyyS=Psxmhppk79c6fDoxPbV91jE7fO_9A@mail.gmail.com>
2021-08-27  6:57 ` Touchpad stickiness on Dell Inspiron/XPS Andrea Ippolito
2021-09-23  8:47   ` Andrea Ippolito
2021-09-23  9:00     ` Hans de Goede
2021-09-23  9:06       ` Andrea Ippolito
2022-01-06 13:14       ` Wolfram Sang
2022-01-11 10:34         ` Touchpad stickiness on AMD laptops (was Dell Inspiron/XPS) Hans de Goede
2022-01-11 11:13           ` Benjamin Tissoires
2022-01-11 23:15             ` Limonciello, Mario
2022-01-12  8:33               ` Wolfram Sang
2022-01-12 12:21                 ` Miroslav Bendík [this message]
2022-01-12 22:54                   ` Limonciello, Mario
2022-01-15  9:39                     ` Miroslav Bendík
2022-01-15 13:46                       ` Limonciello, Mario
2022-01-15 18:10                         ` Miroslav Bendík
2022-01-17  8:39                         ` Miroslav Bendík
2022-01-17  9:08                           ` Hans de Goede
2022-01-23 17:25                             ` Miroslav Bendík
2022-01-12 12:31                 ` Hans de Goede
2022-01-30 13:14               ` Miroslav Bendík
2022-02-06 18:13               ` Miroslav Bendík

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=596d6af1-d67c-b9aa-0496-bd898350865c@wisdomtech.sk \
    --to=miroslav@wisdomtech.sk \
    --cc=Nehal-bakulchandra.Shah@amd.com \
    --cc=alex.hung@canonical.com \
    --cc=andrea.ippo@gmail.com \
    --cc=btissoir@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.