linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Nick Dyer <nick@shmanahar.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jiada Wang <jiada_wang@mentor.com>,
	Linux Input <linux-input@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	linux-tegra <linux-tegra@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] Input: atmel_mxt_ts - support wakeup methods
Date: Sun, 6 Dec 2020 22:42:37 +0300	[thread overview]
Message-ID: <1c98644e-dd57-026e-54d2-59f3398bdd6d@gmail.com> (raw)
In-Reply-To: <CACRpkdZoxsamwCpckeMOVSkK_DQOqakmZ3fHzYb8CeSGZ1V_NA@mail.gmail.com>

06.12.2020 18:20, Linus Walleij пишет:
> On Sat, Dec 5, 2020 at 6:48 AM Dmitry Osipenko <digetx@gmail.com> wrote:
> 
>> According to datasheets, chips like mXT1386 have a WAKE line, it is used
>> to wake the chip up from deep sleep mode before communicating with it via
>> the I2C-compatible interface.
>>
>> If the WAKE line is connected to a GPIO line, the line must be asserted
>> 25 ms before the host attempts to communicate with the controller. If the
>> WAKE line is connected to the SCL pin, the controller will send a NACK on
>> the first attempt to address it, the host must then retry 25 ms later.
>>
>> Implement the wake-up methods in the driver. Touchscreen now works
>> properly on devices like Acer A500 tablet, fixing problems like this:
>>
>>  atmel_mxt_ts 0-004c: __mxt_read_reg: i2c transfer failed (-121)
>>  atmel_mxt_ts 0-004c: mxt_bootloader_read: i2c recv failed (-121)
>>  atmel_mxt_ts 0-004c: Trying alternate bootloader address
>>  atmel_mxt_ts 0-004c: mxt_bootloader_read: i2c recv failed (-121)
>>  atmel_mxt_ts: probe of 0-004c failed with error -121
>>
>> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> 
> OK looks interesting!
> 
>> +       /* Request the WAKE line as asserted so controller won't sleep */
>> +       data->wake_gpio = devm_gpiod_get_optional(&client->dev,
>> +                                                 "wake", GPIOD_OUT_HIGH);
>> +       if (IS_ERR(data->wake_gpio)) {
>> +               error = PTR_ERR(data->wake_gpio);
>> +               dev_err(&client->dev, "Failed to get wake gpio: %d\n", error);
>> +               return error;
>> +       }
> 
> That is a bit brutal, don't you think? Now you force the controller
> to be on at all times. Even across suspend/resume.

Still it's better than a disfunctional hardware :)

> Shouldn't the same patch drive this low in mxt_suspend()
> and driver it high + wait 25 ms in mxt_resume()?
> Waiting 25ms in mxt_resume() is chill, it is anyway on the
> slowpath.

I don't have hardware which uses the wake-gpio in order to test that it
works properly, hence wanted to keep it minimal. But indeed sounds like
toggling the GPIO in suspend/resume should be okay to do. Alright, I'll
improve it in the v3. Thank you!

  reply	other threads:[~2020-12-06 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05  5:47 [PATCH v2 0/3] Support wakeup methods of Atmel maXTouch controllers Dmitry Osipenko
2020-12-05  5:47 ` [PATCH v2 1/3] dt-bindings: input: atmel_mxt_ts: Document atmel,wakeup-method and wake-GPIO Dmitry Osipenko
2020-12-05  5:47 ` [PATCH v2 2/3] Input: atmel_mxt_ts - support wakeup methods Dmitry Osipenko
2020-12-06 15:20   ` Linus Walleij
2020-12-06 19:42     ` Dmitry Osipenko [this message]
2020-12-05  5:47 ` [PATCH v2 3/3] ARM: tegra: acer-a500: Add atmel,wakeup-method property Dmitry Osipenko

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=1c98644e-dd57-026e-54d2-59f3398bdd6d@gmail.com \
    --to=digetx@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jiada_wang@mentor.com \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=nick@shmanahar.org \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --subject='Re: [PATCH v2 2/3] Input: atmel_mxt_ts - support wakeup methods' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).