public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: R Ha <rha051117@gmail.com>
Cc: wsa+renesas@sang-engineering.com, linux-i2c@vger.kernel.org,
	linux-acpi@vger.kernel.org, trivial@kernel.org
Subject: Re: [PATCH 1/1] Force ELAN06FA touchpad I2C bus freq to 100KHz
Date: Tue, 7 Jan 2025 09:27:46 +0200	[thread overview]
Message-ID: <20250107072746.GW3713119@black.fi.intel.com> (raw)
In-Reply-To: <CACHtJB94K5OLdHgs8dDj4jDBtZmsdymovboCcJJUt5OkD8o+Mg@mail.gmail.com>

Hi,

On Mon, Jan 06, 2025 at 03:00:53AM -0600, R Ha wrote:
> On Sun, Jan 5, 2025 at 2:34 AM Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> > In general it is good to follow the existing changelogs but in this case I
> > would prefer to add the details of the system in question (so we know what
> > systems the quirk is applied to).
> 
> Alright, I sent an updated patch with a commit message that specifies
> the devices affected.
> 
> On Sun, Jan 5, 2025 at 2:34 AM Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> > Okay thanks for sharing. I don't see the "SPED" beeing assigned in the
> > below snipped though.
> 
> I believe "SPED" is left unassigned. There are two reasons for this.
> 1. I could not find a place where it was assigned in the ACPI table
> (in the snippet, every line with the word "SPED" was already
> included).
> 2. In the file drivers/i2c/busses/i2c-designware-common.c, the code in
> the function "i2c_dw_adjust_bus_speed" falls through to the "else"
> case.
> 
> For (2), here is the relevant function where the control flow falls to
> the "else" case. I found this by adding a print-debugging statement
> after the last "else" statement.
> static void i2c_dw_adjust_bus_speed(struct dw_i2c_dev *dev)
> {
>     u32 acpi_speed = i2c_dw_acpi_round_bus_speed(dev->dev);
>     struct i2c_timings *t = &dev->timings;
> 
>     /*
>      * Find bus speed from the "clock-frequency" device property, ACPI
>      * or by using fast mode if neither is set.
>      */
>     if (acpi_speed && t->bus_freq_hz)
>         t->bus_freq_hz = min(t->bus_freq_hz, acpi_speed);
>     else if (acpi_speed || t->bus_freq_hz)
>         t->bus_freq_hz = max(t->bus_freq_hz, acpi_speed);
>     else
>         t->bus_freq_hz = I2C_MAX_FAST_MODE_FREQ;
> }
> 
> Actually, after some further investigation, I found that I missed a
> few lines in my previous snippet. Specifically the line concerning the
> method "I2CSerialBusV2".
> Here is the full snippet pasted below since I don't want to miss
> anything else, I'm sorry for the length but want to make sure
> everything is included.

Thanks! Okay the speed set in the I2CSerialBusV2 resource is 400kHZ but
there is one more variable in this equation: \\_SB.PC00.I2C1 that's the I2C
controller itself. DW I2C has some timing related methods (HCNT/LCNT) that
may affect this so I wonder if you can share that one too?

> Scope (_SB.PC00.I2C1)
> {
>     Name (I2CN, Zero)
>     Name (I2CX, Zero)
>     Name (I2CI, One)
>     Method (_INI, 0, NotSerialized)  // _INI: Initialize
>     {
>         I2CN = SDS1 /* \SDS1 */
>         I2CX = One
>     }
> 
>     Device (TPD0)
>     {
>         Name (HID2, Zero)
>         Name (SBFB, ResourceTemplate ()
>         {
>             I2cSerialBusV2 (0x002C, ControllerInitiated, 0x00061A80,
>                 AddressingMode7Bit, "\\_SB.PC00.I2C1",
>                 0x00, ResourceConsumer, _Y53, Exclusive,
>                 )
>         })

  reply	other threads:[~2025-01-07  7:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03  5:16 [PATCH 0/1] Force I2C bus freq to 100KHz for ELAN06FA touchpad Randolph Ha
2025-01-03  5:16 ` [PATCH 1/1] Force ELAN06FA touchpad I2C bus freq to 100KHz Randolph Ha
2025-01-03  9:33   ` Mika Westerberg
2025-01-03 23:46     ` R Ha
2025-01-05  8:33       ` Mika Westerberg
2025-01-06  1:28         ` [PATCH] " Randolph Ha
2025-01-06  9:00         ` [PATCH 1/1] " R Ha
2025-01-07  7:27           ` Mika Westerberg [this message]
2025-01-07 12:16             ` R Ha
2025-01-08  5:51               ` Mika Westerberg
2025-01-08  9:29                 ` R Ha
2025-01-09 11:19                   ` Mika Westerberg
2025-01-10  8:31                     ` R Ha
2025-01-10 11:26                       ` Mika Westerberg
2025-01-10 11:45                         ` Jarkko Nikula
2025-01-10 12:07                           ` Mika Westerberg
2025-01-11 15:57                             ` [PATCH] " Randolph Ha
2025-01-13  6:48                               ` Mika Westerberg
2025-01-13 19:52                                 ` Randolph Ha
2025-01-14 11:58                                   ` Wolfram Sang
2025-01-15 19:39                                     ` R Ha
2025-01-11 16:05                             ` [PATCH 1/1] " R Ha
2025-01-13  6:49                               ` Mika Westerberg
2025-01-06  9:08         ` R Ha

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=20250107072746.GW3713119@black.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=rha051117@gmail.com \
    --cc=trivial@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox